Subject Re: [firebird-support] Context variables
Author Ivan Prenosil
> d_from is timestamp in dialect3 database inside an SP
>
> 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)

Right, the construct above works in dialect-1 only.
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