Forum Discussion
Expression Error: < to Types Date and Number
- 9 years ago
Hi j_t0418,
In your Query statement, 5/23/17 is recognised as text, please use #date(2017,5,23). Please use the following statement, and check if it works fine.
if [SupplierText]="X" and [Date]>= #date(2017,5,23) and [Date]<=#date(2017,6,8) and [Number]=null then 0 else if [SupplierText]="X" and [Date]>= #date(2017,5,23) and #date(2017,6,8) and [TypeText]="X" then [Number] else if [SupplierText]="X" and [Date]>= #date(2017,5,23) and #date(2017,6,8) and [TypeText]="Y" then 0 else if [SupplierText]="X" and [Date]>= #date(2017,5,23) and #date(2017,6,8) and [TypeText]="Z" then 0 else [Number2]
Best Regards,
Angelia
Hi j_t0418,
In your Query statement, 5/23/17 is recognised as text, please use #date(2017,5,23). Please use the following statement, and check if it works fine.
if [SupplierText]="X" and [Date]>= #date(2017,5,23) and [Date]<=#date(2017,6,8) and [Number]=null then 0 else if [SupplierText]="X" and [Date]>= #date(2017,5,23) and #date(2017,6,8) and [TypeText]="X" then [Number] else if [SupplierText]="X" and [Date]>= #date(2017,5,23) and #date(2017,6,8) and [TypeText]="Y" then 0 else if [SupplierText]="X" and [Date]>= #date(2017,5,23) and #date(2017,6,8) and [TypeText]="Z" then 0 else [Number2]
Best Regards,
Angelia
- j_t04189 years agoFrequent Visitor
This solution worked seamelessly. Thank you for your help!
- Bennes7 years agoFrequent Visitor
I have similar issue, and the advice posted in this forum didn`t help.
#"Changed Type" = Table.TransformColumnTypes(TIMEFACTSDAY1,{{"DAY", type date}}),
#"Filtered Rows" = Table.SelectRows(TIMEFACTSDAY1, each not List.Contains({129,1142},[USER_ID]) or [DAY] <= #date(2018, 1, 1))
in
#"Filtered Rows""we cannot apply operator to types date and datetime"
Where could be the problem please?
Thanks