Page 1 of 1

Construct a date from a string

Posted: Wed Nov 24, 2004 6:44 pm
by anilkona
Hello,

I am trying to construct a date from string like

IConv("2004-1-1","yyyymmdd")

This does not seem to work. I am trying to insert this in to a DB2 database table and column is of type 'Date'.

Any help is appreciated.

thanks,
-Anil

Posted: Wed Nov 24, 2004 7:16 pm
by chucksmith
Try:

Code: Select all

Iconv("2004-01-01", "D4-YMD[4,2,2]")

Posted: Wed Nov 24, 2004 7:22 pm
by kcbland
Search this forum for "DB2" and "date" and you'll get to learn all the issues with using the plugin with dates. My apologies in advance...

Posted: Wed Nov 24, 2004 7:25 pm
by ray.wurlod
The second argument of Oconv() and Iconv() when dealing with dates always begins with "D". It is NOT a date picture.

Bring up on-line help on topic "D" (actually "D Code (BASIC)") for more information, or visit Date Conversion Demystified