Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a field that appears like this
If i want another list bos with just the date, year or month what do I need to write in the load script. I've tried, Date(), Date#() and Date(Date#() to get date, and none work. Maybe I am using one of the above QV functions incorrectly, I dont know
Thanks,
Byron
The two pieces of code Im using as a final reply to this thread
Date(DayStart(DateTime)) as Date
Time(DateTime-Date(DayStart(DateTime)),'hh:mm:ss') as IntervalTime
I seem to have gotten it right with this
Date(Round(DateTime,1),'YYYY/MM/DD'). If there is another way please let me know. Not sure if this method restricts my reporting in any kind of way
Ok, but now another problem. I need just the time
Ok got this too, but my method looks ugly
Time(DateTime-Date(Round(DateTime,1)),'hh:mm:ss') as IntervalTime
Any other suggestions????
Hi,
Try this:
LOAD DateTime,
DATE(DAYSTART(DateTime), 'DD/MM/YYYY') AS Only_Date,
DATE(DateTime, 'hh:mm:ss') AS Only_Time;
...
Thanks Ecorrea,
Only_Date worked but not the Only_Time. Only_Time shows me time in that format, but I would see the same time appear more than once. This is probably due to the fact that the timestamp it is linked to is picking up different dates with that time
Byron, Try With this.
Date(Timestamp#(DateTime,'DD/MM/YYYY hh:mm:ss tt')) as Date,
Month(Timestamp#(DateTime,'DD/MM/YYYY hh:mm:ss tt')) as Month,
Time(Timestamp#(DateTime,'DD/MM/YYYY hh:mm:ss tt')) as Time
hope this helps you.
- Sridhar
You may try this:
date( MakeDate(left(Date,4), mid(Date,5,2 ),right(Date,2 )),'YYYY/MM/DD') as [Start Period]
You can take or split what you need.I hope it helps!!
Hi Scridhar,
No luck with any of those
----------------------------------------------------------------
Hi Javortiz
I can use that but all that a timestamp is, is a number with decimals. So to get date, all I need to do is remove decimals. Therefore I could use your code, but I dont really need to recreate the date, just round it down to the nearest integer.
------------------------------------------------------------------
I am currently using Eccorea's code for the date as the 'round' has issues unless I can tell it to round down.
Thanks to all for your replies and insight. Much appreciated
Cheers,
Byron
The two pieces of code Im using as a final reply to this thread
Date(DayStart(DateTime)) as Date
Time(DateTime-Date(DayStart(DateTime)),'hh:mm:ss') as IntervalTime