Feb 1, 2010 #1 barra47 Programmer Joined Dec 25, 2002 Messages 86 Location AU I need to write a query to filter records that were created in the previous week, can you please help me with this one, Thanks in advance Each record has an OpenDate field.
I need to write a query to filter records that were created in the previous week, can you please help me with this one, Thanks in advance Each record has an OpenDate field.
Feb 1, 2010 #2 dhookom Programmer Joined Jun 24, 2003 Messages 22,561 Location US Code: SELECT * FROM tblNoNameGiven WHERE OpenDate Between Date()-7 and Date(); Duane Hook'D on Access MS Access MVP Upvote 0 Downvote
Code: SELECT * FROM tblNoNameGiven WHERE OpenDate Between Date()-7 and Date(); Duane Hook'D on Access MS Access MVP
Feb 2, 2010 #3 PWise Programmer Joined Dec 12, 2002 Messages 2,633 Location US Duane: Your code will return the last seven days the previous week Can be more then seven days ago Try: Code: SELECT * FROM tblNoNameGiven WHERE Daterpart("ww",OpenDate)=DatePart("ww",Date())-1; P.S. You still have to adept for the last week of a year. Upvote 0 Downvote
Duane: Your code will return the last seven days the previous week Can be more then seven days ago Try: Code: SELECT * FROM tblNoNameGiven WHERE Daterpart("ww",OpenDate)=DatePart("ww",Date())-1; P.S. You still have to adept for the last week of a year.
Feb 2, 2010 #4 dhookom Programmer Joined Jun 24, 2003 Messages 22,561 Location US I guess this depends on how you interpret "previous week". I consider a week as 7 days. Perhaps barra47 can suggest what is desired. Duane Hook'D on Access MS Access MVP Upvote 0 Downvote
I guess this depends on how you interpret "previous week". I consider a week as 7 days. Perhaps barra47 can suggest what is desired. Duane Hook'D on Access MS Access MVP