Re: Date Conversion
Posted in 1995
>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?
>
---
Andy,
Try using a 4-digit year as part of the date, e.g., 'let p_string = "19950101"'.
(Check the manual regarding the date function.)
Bill Williams
---------------------------------------------------
| Disclaimer: I speak only for myself (it is not |
| possible that I could do otherwise). |
---------------------------------------------------