Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can one group dates in scripting
My example is I have several dates including the time, but I only want to show data for each day and ignore the time?
Hope this makes sense.
regards
M
You can use the floor function to cut of the time part from a date:
date(floor(MyDateTime),'DD-MM-YYYY') as MyDate
If your datetime (timestamp) field doesn't contain numeric values but text values you can use the date# function to turn the text values into dates. You'll still should use the floor function. Date(floor(date#(MyField, 'YYYYMMDD hhmmss')),'DD-MM-YYYY')
Note, all the date and timestamp formats above are just examples. Use the formats you actually need.
Hi Mina,
you can strip out the hh:mm:ss etc, and just keep the date
an example of this is:
FixDate:
Load * inline
[
TimeStamp
24/02/1958 11:12:32
];
FinalDate:
Load
TimeStamp,
Date(Floor(TimeStamp)) as NewDate
Resident FixDate;
Gives a new date of 24/02/1958 from 24/02/1958 11:12:32
Regards
Andy
Thank you
Thank you.
Hi,
you could use
DayName(YourTimestampField)
to purge the time part from the timestamp and format as a date
hope this helps
regards
Marco