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

Search records by week

Status
Not open for further replies.

grann

Programmer
Jun 3, 2001
6
EU
I have a search form which I use for selecting records for a specific period. This is done by two fields where I put in start and end date. This works fine. What I worn a do, is to just selct a week, and then all records from that week shall be found.
Anybody know a way to do this ??

Grann
 
Depends (n part) on your definition of a week.

One of the datepart arguments is the interval. One valid value for that argument is "ww" - which returns the week number.

So, as a simplistic example of it's use:

MyDate = Date
? MyDate
10/28/01
? DatePart("ww", MyDate)
44

which should show any "Programmer" how to apply the process to identify a group of dates within a standard week. For more info on standard functions and their use, please refer to the Help system supplied with your programming environment. I do HIGHLY recommend refering to the help system for this process, as it DOES refer attributes (e.g 'First Week of Year') and pther optional arguments which may have an impact on the reasults.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Hi Michael,
I do know about the datepart arguments, and it is easy to find out what week a specific date is in.
What I worn a do is selecting by week. I for instence worn a find all record last edited in week 44. Indstead of having a start time and a end time, I just worn a have a list box where I can select week 44.

Grann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top