Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Datefirst question

Status
Not open for further replies.

gaperry

IS-IT--Management
Jan 29, 2002
37
US
I have a "view" where I am using DATEPART (week, [mydate])to show the current week and I need to make sure that the week shows up in the view based on the week starting on Monday instead of the standard US week which starts on Sunday. What is the best way to combine DATEFIRST with DATEPART to accomplish this in a view ? Thanks in advance.

 
This is something we use to get last weeks data....this would be time for the previous Monday...not sure if it will help...

select sum(isnull(w.units,0))
from tblwip w
where w.chargetypeid=24
and datediff(dd,date,getdate()-(7 + datepart(dw,getdate())-2))=0 and w.staffid=974
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top