Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to create a datetime from data that is stored in two separate field. The date field is stored as a datetime, but the time part is always 00:00:00 so I need to extract just the date. The time field is stored as minutes after midnight, i.e. 630 = 10:30:00 AM.
Hi,
Load like this
T1:
Load * Inline [
Time
630
];
T2:
Load Time,
Timestamp('00:'&Time,'hh:mm:ss[.fff] TT') as Hours
Resident T1;
Drop Table T1;
Hope it helps you..
Karen Gerdes wrote:
I need to create a datetime from data that is stored in two separate field. The date field is stored as a datetime, but the time part is always 00:00:00 so I need to extract just the date. The time field is stored as minutes after midnight, i.e. 630 = 10:30:00 AM.
If you need just the date, should not be bothered about time part, try like:
Load
Date(Floor(YourDateField)) as NewDate
=datetimefield + timeinminutesfield / (24*60)
datetime.adjust(string.datetime(date,"MMDDCCYY"),1,"Y")
datetime.adjust(srting.datetime(date,"MMDDCCYY"),1,"Y",false)
Hi,
Load like this
T1:
Load * Inline [
Time
630
];
T2:
Load Time,
Timestamp('00:'&Time,'hh:mm:ss[.fff] TT') as Hours
Resident T1;
Drop Table T1;
Hope it helps you..
Hi Karen,
you can try the Time Function.
e.g. Time(A) where A=630
Thank you for all the help. It looks like this worked:
timestamp#
(Date(Floor(start_date))&' '& Timestamp('00:'&start_time,'hh:mm:ssTT'),'YYYY-MM-DD hh:mm:ss')