jbalbo
SSCertifiable
Points: 7583
More actions
March 20, 2013 at 11:40 am
#394436
can I use something like ...
if DATEPART(MM,OrderDate) = 12 then (APPT_RPT_APPOINTMENT.DURATION / 60) AS Decschedhours in a select ??
Thanks in Advance
Joe
Lamprey13
Points: 6210
March 20, 2013 at 11:44 am
#1599041
If you are trying to generate a column, then you should probably use a CASE expression. An IF statement is used for flow control.
March 20, 2013 at 11:46 am
#1599042
Forgot my sample:CASE
CASE
WHEN DATEPART(MM,OrderDate) = 12
THEN (APPT_RPT_APPOINTMENT.DURATION / 60)
ELSE NULL
END AS Decschedhours
March 20, 2013 at 11:51 am
#1599046
Thanks
That works great..
I even understand it!! 🙂
Thanks Again
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply