I am trying to create a query to return the Number of hours worked in the current week. However, I have two years of data and for some reason this query is pulling data from last year and not the current year. I'm new at this and am sure I'm probably overlooking the obvious. Thanks for any input you might have.
Ron
P.S. 'Pay_Ending_Date' is a 'DateTime Datatype
'Hrs' = SUM(CASE WHEN DATEPART(WW, CURRENT_TIMESTAMP) = DATEPART(WW, Pay_Ending_Date) THEN [Bill Hours] ELSE '0' END)
Ron
P.S. 'Pay_Ending_Date' is a 'DateTime Datatype
'Hrs' = SUM(CASE WHEN DATEPART(WW, CURRENT_TIMESTAMP) = DATEPART(WW, Pay_Ending_Date) THEN [Bill Hours] ELSE '0' END)