troubleshooting Question

CAN I USE DATEPART IN ( ) ?

Avatar of PHS_IT
PHS_IT asked on
Microsoft SQL ServerMicrosoft SQL Server 2005
6 Comments1 Solution197 ViewsLast Modified:
What is wrong with this statement?  I know I must have a comma out of place, or a ( in the wrong place.  Or can I not use IN with DATEPART???

CASE WHEN TPR200_EMPLOYEE_MASTER.lst_rvw_dt IS NULL AND
DATEPART(m, TPR200_EMPLOYEE_MASTER.nxt_rvw_dt) IN ('5', '6', '7')) THEN 1
         ELSE 0 END AS CountDueQtr1
ASKER CERTIFIED SOLUTION
ptjcb

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros