By the way, Bhavbhuti,
CAST(COALESCE(tPB.dBillDt, '') AS TIMESTAMP) AS tDocDt
will fail if tPB.dBillDt is null since '' cannot be converted to a timestamp
(it is neither a timestamp nor null).
Set
Thanks Svein. Would you suggest I double COALESCE it? I think it will be an
overkill and I might end up with an ANSI datetime again.
Or should I not COALESCE it at all? I wanted a blank date time in case of a
NULL for tBillDt and if there is a date in tBillDt I need
it for date calculation
Svein, Bhavbhuti has a background as a Visual FoxPro developer and in that
language exist empty dates.
Probably is the reason why he had casted an empty string as a timestamp.
The same thing had happened to me when I was learning SQL.
Greetings.
Walter.
On Tue, May 13, 2014 at 4:02 AM,
Hi Bhavbhuti,
I do not know the exact solution, but I'd say:
COALESCE(CAST(tPB.dBillDt AS TIMESTAMP), '') AS tDocDt
converts timestamp inside servers environment to a string - the
returning client receives a string and does not know about it's datatype
- yet does not a apply specific