Re: Date Conversion
Posted in 1995
} From: akent@cix.compulink.co.uk ("Andy Kent") } Subject: Date Conversion } Date: Tue, 4 Apr 1995 14:34:35 GMT } Reply-To: akent@cix.compulink.co.uk ("Andy Kent") } Organization: Andy Kent Associates Limited } } I'm trying to move dates from a CHAR datatype to a DATE one. I keep } either getting -1212 (Date conversion must contain a year, a month and a } day), or the target field ending up null. } } I've checked all the obvious things like DBDATE (it's ymd2) and I've } tried it with or without the date() function. Am I just missing something } really dumb? For example, the following stored procedure generates a } -1212 on the 'let p_date...' statement: } } create procedure date_test() returning date,char(12); } } define p_date date; } define p_string char(12); } } let p_string = "950101"; } let p_date = date(p_string); } } return p_date, p_string; } } end procedure; } } Any clues? } } akent@cix.compulink.co.uk (Andy Kent) } ------------------------------------------------ } Freelance Informix Database Specialist, } Redland, Bristol, England It appears that the DBDATE value you want is Y2MD0. The number of year digits must follow the "Y"; the "0" at the end specifies no separator. All examples in my manuals give the "YMD" characters in upper case, rather than lower. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Lockheed Martin, SLS | / \\ alan@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\