Subject | Re: [firebird-support] Context variables |
---|---|
Author | Ivan Prenosil |
Post date | 2005-03-15T11:38:24Z |
> d_from is timestamp in dialect3 database inside an SPRight, the construct above works in dialect-1 only.
>
> d_from = '31.12.2004 13:45:17';
> d_from = CAST(CAST (d_from AS VARCHAR(11)) as DATE);
>
> gives truncation error (I want just the date portion of the initial contents)
But SUBSTRING was introduced long time ago in Firebird-1,
so use it instead of CAST:
CAST(SUBSTRING (d_from FROM 1 FOR 11) as DATE)
Or use EXTRACT to get day/month/year, and then put them together
to form correct date string.
Ivan