问题
I have timestamp column where I have written following expression to filter the column:
contact_date >= toTimestamp('2020-01-01') &&
contact_date <= toTimestamp('2020-12-31')
It doesn't complain about syntax but after run it doesn't filter based on date specified. Simply to say logic doesn't work. Any idea?
Date Column in Dataset:
回答1:
Please don't use toTimestamp()
function. I tested and you will get null output.
I use a Filter active to filter the data. Please use the toString()
and change the expression like bellow:
toString({contact_date })>= toString('2020-01-01') && toString({contact_date })<= toString('2020-12-31')
Ref my example, contact_date
and output:
回答2:
I think you need to either add the hour, minute and second portions of your dates or specify an appropriate format string, as per the docs, "If the timestamp is omitted the default pattern yyyy-[M]M-[d]d hh:mm:ss[.f...] is used."
回答3:
Hi put in and operation or in () ie
(contact_date >= toTimestamp('2020-01-01') && contact_date <= toTimestamp('2020-12-31'))
or
AND(contact_date >= toTimestamp('2020-01-01') , contact_date <= toTimestamp('2020-12-31'))
来源:https://stackoverflow.com/questions/64897642/how-to-filter-timestamp-column-in-data-flow-of-azure-data-factory