Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I have a dateset the I want to a customs date filter on query editor, which wil help me do the following as SQL:
SCANDATE BETWEEN TRUNC(SYSDATE)+(1/24) AND TRUNC(SYSDATE)+1
So I use
= Table.SelectRows(CARTONTRACKING1, each [SCANDATE] >= Date.From(DateTime.LocalNow())+#duration(0, 1, 0, 0) and [SCANDATE] <= Date.From(DateTime.LocalNow())+#duration(0, 24, 0, 0))
becasue my [SCANDATE] is a datetime type
Trying to first trunc the system time to for exmaple 6/4/2018 12:00:00 AM then add 1 hours so it becomes 6/4/2018 1:00:00 AM,
But it gives me a error
Expression.Error: We cannot apply operator < to types Date and DateTime. Details: Operator=< Left=6/4/2018 Right=11/2/2011 10:31:49 PM
Solved! Go to Solution.
In the Modeling Ribbon there is a Data type that you can convert from date time to date and vice versa.
You can just use the "&" I guess: Date.From(DateTime.LocalNow())&#time(1, 0, 0)
i try
= Table.SelectRows(CARTONTRACKING1, each [SCANDATE] >= Date.From(DateTime.LocalNow())+#time(1, 0, 0) and [SCANDATE] <= Date.From(DateTime.LocalNow())+#time(1, 0, 0))
but it said
Expression.Error: We cannot apply operator + to types Date and Time.
Details:
Operator=+
Left=6/4/2018
Right=1:00:00 AM
I think I have to first conver Date.From(DateTime.LocalNow()) to datetime, becuase Date.From(DateTime.LocalNow()) give me date type not date time. but not sure how to do that
In the Modeling Ribbon there is a Data type that you can convert from date time to date and vice versa.
I got it, using:
#datetime(Date.Year(Date.From(DateTime.LocalNow())),Date.Month(Date.From(DateTime.LocalNow())),Date.Day(Date.From(DateTime.LocalNow())),1,0,0)
Thanks
Not sure I undestand or not, what I expect is for example
6/4/2018 1:00:00 AM
Date.From(DateTime.LocalNow()) will give me 6/4/2018 but thre is no time, since it is a date type, so I am not aboe to add 1 hours to this. I need first make 6/4/2018 to 6/4/2018 12:00:00 AM
User | Count |
---|---|
127 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |