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

Using BETWEEN in ACCESS Query, how can I label the Week Number?

Status
Not open for further replies.

tol514

Programmer
Feb 1, 2005
16
US
I have a huge file. One of the fields is FROM DATE, or [DATE]. How can I code a Query expression that would say, for example, IIF [DATE} BETWEEN X AND Y, then label this field 9 - where 9 is the week of the year? Or is there an easier way? I have to create a field, through ACCESS Query,that would hold the week number, so that I can transfer the file to XLS and to Payroll.

Tom Walsh, HRIS Analyst
Capital Health System
ADP HR&Payroll wi RSmith
 
Hi,

First I would change your Field Name, as Date is a reserve word in many MS applications.

How are you defining Week of Year, with respect to what? My Week of Year may start on a differnt day than your Week of Year start.



Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
see the ubiquitous "Help" (aka "F1") for DatePart.

? DatePart("ww", Date())
50

'Date being 12/11/2008

'Be SURE to read through the help AND review the info on the arguments.



MichaelRed


 
Thank, Michael - the DataPart Function did it!! I like your use of those splendid words, too! Tom

Tom Walsh, HRIS Analyst
Capital Health System
ADP HR&Payroll wi RSmith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top