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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deriving the first date from a week number?

Status
Not open for further replies.

Shawn12

Programmer
Sep 27, 2006
50
US
Hi Folks,

I use this to get a week number for a date range:

WeekNo: DatePart("ww",[Timestamp])

Is there a way that I could also get just the first date from that week number to appear in the query as well?

ie. if Week 1 is 3/1/07-3/7/07 the query would show 3/1/07 as well as week 1. TIA
 
I don't understand your values since it seems you are typing in m/d/yy but that wouldn't be the first week and neither 1/3 or 3/1 are the first day of the week in 2007.

You can use something like:
WeekBeginning: DateAdd("d",-Weekday([Timestamp])+1,[Timestamp])

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top