473,466 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Selecting the current week


I've been Googling and reading for 5 days now trying to figure out how
to write a query that selects records with dates in the current week
(Sun to Sat). You'd think it would be remarkably simple (maybe it is),
but I can't find a simple answer.

If anyone could provide a relatively simple method, I would very much
appreciate it.

Thanks -

G

Mar 14 '06 #1
4 13243
To follow-up...

This is the best I have so far. I add this as my criteria for the date
field in my query to select events during the past 2 weeks.
DateAdd("ww",-2,Date())


Mar 14 '06 #2
Put the following expression in the criteria of your date field:

DatePart("ww",[MyDate])=DatePart("ww",Date()) AND
Year([MyDate])=Year(Date())
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com


"GregginOttawa" <gs*******@rogers.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...

I've been Googling and reading for 5 days now trying to figure out how
to write a query that selects records with dates in the current week
(Sun to Sat). You'd think it would be remarkably simple (maybe it is),
but I can't find a simple answer.

If anyone could provide a relatively simple method, I would very much
appreciate it.

Thanks -

G

Mar 14 '06 #3

"Steve" <no****@nospam.spam> schreef in bericht news:gx****************@newsread2.news.atl.earthli nk.net...

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications 'Resource ????
Over 1150 users have come to me from the newsgroups requesting help '1150 users ????
re******@pcdatasheet.com



--
To Steve:
Over 500!! users from the newsgroups have visited the website to read what kind of a 'resource' you are... (rapidly increasing..)

To the original poster:

Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
Mar 14 '06 #4
GregginOttawa wrote:
I've been Googling and reading for 5 days now trying to figure out how
to write a query that selects records with dates in the current week
(Sun to Sat). You'd think it would be remarkably simple (maybe it is),
but I can't find a simple answer.

If anyone could provide a relatively simple method, I would very much
appreciate it.

Thanks -

G


In a prior thread, Wayne Morgan noted that:

Date() - Weekday(Date()) + 1

produces the date of Sunday on or before Date().

A version that is less cozy with the implementation of dates is:

DateAdd("d", 1 - Weekday(Date()), Date())

The following Saturday is:

DateAdd("d", 7 - Weekday(Date()), Date())

This will work for finding the current week for dates in the past and
future as well.

James A. Fortune
CD********@FortuneJames.com

Mar 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: deko | last post by:
This runs, but does not narrow to current week. suggestions appreciated! SELECT lngEid, dtmApptDate, Subject, Appt_ID FROM qry002 WHERE (dtmApptDate BETWEEN DateAdd("d",-weekday()+2,) And...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
1
by: kennyscripts | last post by:
Hi Friends...... How to get the current month and current week in vb.net 2003 Can view the month textbox details and can only enter the week detail. How to get? Anybody knows give the answer....
5
by: bruce24444 | last post by:
I have a database which assigns warranty claims to people with a main screen showing number of files assigned to each person. The number assigned shows day, week, month and year numbers so they can...
5
by: Chris | last post by:
I am trying to output Monday of the current week i.e. if Monday is the 8th I want to display 'Monday 8th' for any date between Monday 8-14th. I would appreciate any help, the code below is...
5
by: juster21 | last post by:
I have a listbox populated with all the week ending dates of 2008 where Sunday is the last day of the week (1/6/08, 1/13/08, etc.) I need to select the most current week ending date upon the form...
5
by: Aljosa Mohorovic | last post by:
i use this to find out current week and total number of weeks for current year: now = datetime.now() weeks_in_year = int(date(now.year, 12, 31).strftime("%W")) current_week = int(date(now.year,...
7
by: anu | last post by:
Please let me know how I can get the starting date of the current week in PHP.
3
by: Jeff | last post by:
hi asp.net 2.0 sql server 2005 I have a GridView on my webpage. Sometimes I want to query the bound datasource in different ways.: - Get all arroved records - Get all unapproved records -...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.