Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i format Date string??? 1

Status
Not open for further replies.

anumala28

Programmer
Jun 28, 2002
87
US
Hi,

I need to format date i.e in string format.

'2003/12/30' this string i need to format as YYYYMM

Please give soluation ASAP

Thanks,
Sri
 
Hi,

There is a couple of ways, You can use the following (This is sql for informix). You can use the Year and Month function in Impromptu's function tab:

Year,(date,'%Y%m%d') ||'/' || month(date,'%Y%m%d')
or
substring (TO_CHAR(DATETIME( 2003/07/02 ) YEAR TO DAY ,'%Y-%m-%d')
from 0 for 8)

canhe
 
First Convert the '2003/12/30' to Date by using string to date. Then use Year function to get YYYY and Month to get MM.

Year(date)+Mon(Date).Hope this would be helpful.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top