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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting a number to a date??

Status
Not open for further replies.

Techone1

Programmer
Sep 2, 2008
3
0
0
US
I am trying to convert for ex. 12012008 to 12/01/2008 in 4gl code. There is going to be a list of dates so I am trying to figure out the simplest way in which to code it...any suggestions?
 
You really shouldn't have to do anything. Informix 4GL is very good at performing conversions if it can. This example sets a date equal to a character string. If it's a correct date it'll display. If not, variable dd is set to null

Code:
main
   define dd date,
   str char(10)

let str = "12012008"

let dd = str
display dd # should display 12/01/2008

end main

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top