Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to see if we received entries into a system after 7:45pm and before 11pm on each day. I keep receiving errors that my result set is to large or too small.
How can I return true if I receieve an entry in my recordinsertdate column falls between 7:45pm and 11pm?
My current formula is:
=IF(AND(TIME([RecordInsertDate],[RecordInsertDate],[RecordInsertDate]) > TIME(19,45,0),
TIME([RecordInsertDate],[RecordInsertDate],[RecordInsertDate]) < TIME(23,0,0)),
"TRUE", "FALSE")
My RecodInsertDate has a value format like 20/06/2017 9:46:19 PM
Solved! Go to Solution.
You can consider dates as whole numbers and times as fractions.
Let's take June 22, 2017, 18:00 (or 6:00 PM) as an example.
The date value is 42,908 and the time value 0.75, so together 42,908.75.
In order to get the time value, you need to subtract the integer value, so:
42,908.75 - 42,908 = 0.75 which is equivalent with TIME(18,0,0).
Furthermore, you want TRUE or FALSE as a result (not the text "TRUE" or "FALSE"), so you can just use the AND function with both conditions, which will return TRUE or FALSE. No IF required.
Try this:
= AND(([RecordInsertDate]-INT([RecordInsertDate])) > TIME(19,45,0),([RecordInsertDate]-INT([RecordInsertDate])) < TIME(23,0,0))
Note: if your time is exactly 19:45:00 or 23:00:00, the formula returns false. If this should be true, change the formula to:
= AND(([RecordInsertDate]-INT([RecordInsertDate])) >= TIME(19,45,0),([RecordInsertDate]-INT([RecordInsertDate])) <= TIME(23,0,0))
Thanks, that works but I don't understand why.
You can consider dates as whole numbers and times as fractions.
Let's take June 22, 2017, 18:00 (or 6:00 PM) as an example.
The date value is 42,908 and the time value 0.75, so together 42,908.75.
In order to get the time value, you need to subtract the integer value, so:
42,908.75 - 42,908 = 0.75 which is equivalent with TIME(18,0,0).
Furthermore, you want TRUE or FALSE as a result (not the text "TRUE" or "FALSE"), so you can just use the AND function with both conditions, which will return TRUE or FALSE. No IF required.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
106 | |
87 | |
75 | |
66 |
User | Count |
---|---|
126 | |
112 | |
99 | |
81 | |
73 |