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.
Found the line but it's the most critical of all the transformation steps. I have a table with a start and end of a contract and a daily margin associated. I needed to show the daily margin for all dates between the start and end so expanded the columns
this step pulls out all the dates between start and end and list the all important daily margin accordingly
I don't know how to achieve this another way but all ears?
Thanks.
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.
- Anonymous7 years agoNot applicable
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?
- jakalfayan7 years agoNew Member
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???
- jakalfayan7 years agoNew Member
This didn't fix it. Please help