I have variable called WeekBeginDate
and I want only to pull data for that week. For example, if the beginning of the week date is 07/21/2014
which is Monday
in this case, then I want only to pull the data from 07/21/2014
to 7/27/2014
.
The variable will always contain the date for the beginning of the week only but I don’t have the date for the end of the week.
The week begins on Monday
and ends on Sunday
. I can’t figure out how to calculate or sum the number of hours if I only have the date for the beginning of week.
SELECT DT, sum (TOT_HOURS)as TOT_HOURS FROM MYTABLE where DT >= @WeekBeginDate and <=@WeekEndDate group by DT
Note, that I only have the variable for the WeekBeginDate
.