R
Rafailo
Guest
I have a field name timestamp in sales table which data format is like 20210725.1800 which means 2021-year 07-month 25th-date 00:30:00 AM.
Now, if I want to count the sales on between 30 minutes interval from 20210725.0000 to 20210725.1800, I can do that by simply writing
But, I don't want to run same query 24 times by changing the start and end time of the timestamp field.
So, I am looking for a smarter way to find-out whole day sales count grouped by 30 minutes interval on this timestamp field.
Continue reading...
Now, if I want to count the sales on between 30 minutes interval from 20210725.0000 to 20210725.1800, I can do that by simply writing
Code:
def var k as int no-undo.
for each sales no-lock where salesdate=07/25/2021
and timestamp>=20210725.0000 and timestamp<=20210725.1800.
if available sales then do:
k= k + 1.
pause 0.
display k with frame f.
end.
end.
But, I don't want to run same query 24 times by changing the start and end time of the timestamp field.
So, I am looking for a smarter way to find-out whole day sales count grouped by 30 minutes interval on this timestamp field.
Continue reading...