Forum Discussion
Error refreshing a table: Cannot apply operator...to types number and null
- 9 years ago
Actually the issue is 1 step earlier where you add a column with all dates from start_date through end_date.
If either of these dates is null, then it won't work.
My best guess is that end_date's are missing.
My suggestion would be to use todays date if you have no end date (or something else you can think of), something like:#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each { Number.From([start_date])..Number.From(if [end_date] = null then DateTime.Date(DateTime.LocalNow()) else [end_date]) }),Remark: I adjusted the code out of my head, hopefully it's OK.
Hi,
I have a similar issue. I've have a column with start dates and a column with end dates. Both formatted as Date. No nulls in either of the columns.
I use this code:
#"Added Custom" = Table.AddColumn(#"Changed Type2", "Dates", each List.Transform({Number.From([Fromdate])..Number.From([ToDate])}, each Date.From(_)))And receive the following error when I apply the query changes. No errors when editing the query.
What am i doing wrong?
I'm pulling my data via an API query to our CRM and I'm getting this exact same ERROR even when I create a new column for return date that has the if/then statement in it using Date.From(DateTime.LocalNow())
CAN SOMEONE HELP PLEASE???