Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
5/17/2007 5:32:39 PM
I have above date stored in my data table. I want to extract the following from the date
Hour,
Minute
Week Day (Sunday,Monday etc...)
How can I write the syntax please
If your date field contains text, then try like:
Hour(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Hour,
Minute(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Minute,
WeekDay(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as WeekDay
If your date field contains real timestamp values, then try like:
Hour(yourdatefield) as Hour,
Minute(yourdatefield) as Minute,
WeekDay(yourdatefield) as WeekDay,
hope this helps
regards
Marco
If your date field contains text, then try like:
Hour(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Hour,
Minute(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Minute,
WeekDay(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as WeekDay
If your date field contains real timestamp values, then try like:
Hour(yourdatefield) as Hour,
Minute(yourdatefield) as Minute,
WeekDay(yourdatefield) as WeekDay,
hope this helps
regards
Marco
Thanks Marco
I have written as follows. But it is not working
Pls help
Hour(Timestamp#('LOSS_DATE', 'M/DD/YYYY h:mm:ss TT')) as LOSS_HOUR,
WeekDay(Timestamp#('LOSS_DATE', 'M/DD/YYYY h:mm:ss TT')) as LOSS_DAY,
Hi,
Use
Hour(dateField) as Hour
Minute(dateField) as Minute
WeekDay(DateField) as WeekDay
Regards
Hi,
Since LOSS_DATE is FieldName remove ' before and after fieldName
Hour(Timestamp#(LOSS_DATE, 'M/DD/YYYY h:mm:ss TT')) as LOSS_HOUR,
WeekDay(Timestamp#(LOSS_DATE, 'M/DD/YYYY h:mm:ss TT')) as LOSS_DAY,
Regards