![]() |
|
Archives of the TeradataForumMessage Posted: Mon, 14 Apr 2003 @ 21:31:46 GMT
Hi All, I am trying to get the months between two dates (truncating the decimal portion). When I used the first query I get the result, but when I use the second query, I get the following error in Queryman:
First Query:
SELECT ( DATE '2003-03-08' - DATE '2000-04-14') MONTH
(2003-03-08 - 2000-04-14) MONTH
34
Second Query:
SELECT CASE WHEN (( DATE '2003-03-08' - DATE '2000-04-14') MONTH) IS NULL
THEN 0
ELSE (( DATE '2003-03-08' - DATE '2000-04-04') MONTH)
END AS DEACT_MTHS
Data Type Mismatch in THEN/ELSE expression. What is the data type of MONTH function. Do we need to cast the expression inside the case to INTEGER? Any suggestions will be greatly appreciated. Regards, Arun K Ballari.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||