I have a time field, GMT, that I need to subtract the local time zone from. Example if I am in Dallas I need to subtract 6 hours, Standard, from the time stamp entered. I have the time and another field that has the number of hours behind or ahead. The time filed is datetime, the time zone factor is char(10), stored as -5.00. I have tried to cast or convert, but I know I cannot get the numebr I need.
Here is the code I am using.
SUM(CASE WHEN(DATEPART(HH,(DATEADD(HH,CAST(A.UTC_TCF_MT_QY AS REAL),A.PKG_DEL_TM)))= 09)AND(A.PKG_DEL_DT BETWEEN @dtPuDate1 AND @dtPuDate2)THEN 1 ELSE 0 END)AS PU09
Can anybody tell me what I am doing wrong. I should have a number in the high 1000's, but I get 0.
Thanx
Thank you,
Moe-King of the Village Idiots.
"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
Here is the code I am using.
SUM(CASE WHEN(DATEPART(HH,(DATEADD(HH,CAST(A.UTC_TCF_MT_QY AS REAL),A.PKG_DEL_TM)))= 09)AND(A.PKG_DEL_DT BETWEEN @dtPuDate1 AND @dtPuDate2)THEN 1 ELSE 0 END)AS PU09
Can anybody tell me what I am doing wrong. I should have a number in the high 1000's, but I get 0.
Thanx
Thank you,
![[king] [king] [king]](/data/assets/smilies/king.gif)
"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave