 |
 |
Archives of the TeradataForum
Message Posted: Thu, 23 Feb 2006 @ 21:32:14 GMT
Subj: | | Re: Odd error - Invalid operation on an ANSI Date/Time |
|
From: | | jmfelts |
I found a way to at least get an answer, though it's a bit odd/cludgey...
select b.DayPartDesc, count(*)
FROM TDMProd.FactTable A Join EDWCmnDimProd.DayPartBase B
ON cast(substr(cast(TimeStampCol as char(19)),12,8) as time(0)) >= b.StartTime
AND cast(substr(cast(TimeStampCol as char(19)),12,8) as time(0)) <= b.EndTime
Where ReportingDate in ('2006-01-21')
Group by B.DayPartDesc
This seems a bit odd tough to have to cast to character, substring, and then cast back to time(0). Is there another way?
Mike
| |