Page 1 of 1

Getting Day from Date

Posted: Fri Oct 29, 2004 12:34 pm
by yaminids
Hello there,

Can anyone explain to me to get Day from 'yyyy-mm-dd 00:00:00'
format.

Thanks in advance.
-Yamini

Posted: Fri Oct 29, 2004 12:48 pm
by chulett
Do you just want the 'dd' portion? Are you sure the format will always be as you've indicated? Then substring it out:

Code: Select all

DateField[9,2]

Re: Getting Day from Date

Posted: Sun Oct 31, 2004 3:46 am
by prabu
yaminids wrote:Hello there,

Can anyone explain to me to get Day from 'yyyy-mm-dd 00:00:00'
format.

Code: Select all

DAYOFWEEK = oconv(iconv(EXTRACT_DATE_TO[7,4]:'-':EXTRACT_DATE_TO[4,2]:'-':EXTRACT_DATE_TO[1,2],"D-YMD[4,2,2]"),"DWA")
do you want something like "Monday", "Tuesday" etc. then try above. this for dd-mm-yyyy format