|
|
Archives of the TeradataForum
Message Posted: Tue, 14 Aug 2007 @ 18:49:36 GMT
Subj: | | Re: CASTing to lesser precision |
|
From: | | Dieter Noeth |
Anomy.Anom wrote:
| I like to cast a timstamp field to the lesser precision, the manual says, its not allowed. | |
Stupid, isn't it?
| Is there a workaround for it, or how is it been done in real time, when its required. | |
SELECT CAST(CAST(CURRENT_TIMESTAMP(6) AS CHAR(19)) AS TIMESTAMP(0));
If you run in ANSI mode it's even worse:
SELECT CAST(SUBSTRING(CAST(CURRENT_TIMESTAMP(6) AS CHAR(26)) FROM 1 FOR 19) AS TIMESTAMP(0));
If you don't want that cast then the only solution is to define just the necessary precision :-(
Dieter
| |