A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date Question...



 
 
Thread Tools Display Modes
  #1  
Old May 14th, 2010, 07:41 PM posted to microsoft.public.access.queries
116
external usenet poster
 
Posts: 48
Default Date Question...

I am trying to create a query to give me the results from the first weds of
each month back to the following day after weds. Having trouble formatting
the Date function.

Any help would be greatly appriciated.

Thanks
David
  #2  
Old May 14th, 2010, 09:17 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Date Question...

Create a table CountNumber with field CountNUM containing numbers 0 (zero)
through 6.

SELECT YourTable.*
FROM CountNumber, YourTable
WHERE ((([SomeDate]) Between (Date()-Day(Date())+1)+[CountNUM] And
(Date()-Day(Date())+1)+[CountNUM]-6) AND
((DatePart("w",(Date()-Day(Date())+1)+[CountNUM]))=4));

--
Build a little, test a little.


"116" wrote:

I am trying to create a query to give me the results from the first weds of
each month back to the following day after weds. Having trouble formatting
the Date function.

Any help would be greatly appriciated.

Thanks
David

  #3  
Old May 15th, 2010, 02:24 PM posted to microsoft.public.access.queries
116
external usenet poster
 
Posts: 48
Default Date Question...

Thanks Karl for the quick response. I can somewhat see whats going on here.
I do have it workig. I may have explained incorrectly.

We having company meeting on the first Weds of each month. So I trying to
get the posts between these 2 dates. When the next first Weds comes up, the
old posts will not display, so the posts beyond that Weds drop off the
results list.

David

"KARL DEWEY" wrote:

Create a table CountNumber with field CountNUM containing numbers 0 (zero)
through 6.

SELECT YourTable.*
FROM CountNumber, YourTable
WHERE ((([SomeDate]) Between (Date()-Day(Date())+1)+[CountNUM] And
(Date()-Day(Date())+1)+[CountNUM]-6) AND
((DatePart("w",(Date()-Day(Date())+1)+[CountNUM]))=4));

--
Build a little, test a little.


"116" wrote:

I am trying to create a query to give me the results from the first weds of
each month back to the following day after weds. Having trouble formatting
the Date function.

Any help would be greatly appriciated.

Thanks
David

  #4  
Old May 17th, 2010, 03:57 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Date Question...

I do not follow your explaination.
Given this data --
1 5/1/2010 Sat
2 5/2/2010 Sun
3 5/3/2010 Mon
4 5/4/2010 Tue
5 5/5/2010 Wed
6 5/6/2010 Thu
7 5/7/2010 Fri
8 5/8/2010 Sat
9 5/9/2010 Sun
10 5/10/2010 Mon
11 5/11/2010 Tue
12 5/12/2010 Wed
13 5/13/2010 Thu
14 5/14/2010 Fri
15 5/15/2010 Sat
16 5/16/2010 Sun
17 5/17/2010 Mon

What do you want returned?

--
Build a little, test a little.


"116" wrote:

Thanks Karl for the quick response. I can somewhat see whats going on here.
I do have it workig. I may have explained incorrectly.

We having company meeting on the first Weds of each month. So I trying to
get the posts between these 2 dates. When the next first Weds comes up, the
old posts will not display, so the posts beyond that Weds drop off the
results list.

David

"KARL DEWEY" wrote:

Create a table CountNumber with field CountNUM containing numbers 0 (zero)
through 6.

SELECT YourTable.*
FROM CountNumber, YourTable
WHERE ((([SomeDate]) Between (Date()-Day(Date())+1)+[CountNUM] And
(Date()-Day(Date())+1)+[CountNUM]-6) AND
((DatePart("w",(Date()-Day(Date())+1)+[CountNUM]))=4));

--
Build a little, test a little.


"116" wrote:

I am trying to create a query to give me the results from the first weds of
each month back to the following day after weds. Having trouble formatting
the Date function.

Any help would be greatly appriciated.

Thanks
David

  #5  
Old May 17th, 2010, 06:06 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Date Question...

Given the data below what record set do you want returned?
1 5/1/2010 Sat
2 5/2/2010 Sun
3 5/3/2010 Mon
4 5/4/2010 Tue
5 5/5/2010 Wed
6 5/6/2010 Thu
7 5/7/2010 Fri
8 5/8/2010 Sat
9 5/9/2010 Sun
10 5/10/2010 Mon
11 5/11/2010 Tue
12 5/12/2010 Wed
13 5/13/2010 Thu
14 5/14/2010 Fri
15 5/15/2010 Sat
16 5/16/2010 Sun
17 5/17/2010 Mon

--
Build a little, test a little.


"116" wrote:

Thanks Karl for the quick response. I can somewhat see whats going on here.
I do have it workig. I may have explained incorrectly.

We having company meeting on the first Weds of each month. So I trying to
get the posts between these 2 dates. When the next first Weds comes up, the
old posts will not display, so the posts beyond that Weds drop off the
results list.

David

"KARL DEWEY" wrote:

Create a table CountNumber with field CountNUM containing numbers 0 (zero)
through 6.

SELECT YourTable.*
FROM CountNumber, YourTable
WHERE ((([SomeDate]) Between (Date()-Day(Date())+1)+[CountNUM] And
(Date()-Day(Date())+1)+[CountNUM]-6) AND
((DatePart("w",(Date()-Day(Date())+1)+[CountNUM]))=4));

--
Build a little, test a little.


"116" wrote:

I am trying to create a query to give me the results from the first weds of
each month back to the following day after weds. Having trouble formatting
the Date function.

Any help would be greatly appriciated.

Thanks
David

  #6  
Old May 18th, 2010, 12:36 PM posted to microsoft.public.access.queries
116
external usenet poster
 
Posts: 48
Default Date Question...

Sorry for the confussion. From upcoming first Weds of the month To the day
after the past first Weds of the month.

David

"KARL DEWEY" wrote:

Given the data below what record set do you want returned?
1 5/1/2010 Sat
2 5/2/2010 Sun
3 5/3/2010 Mon
4 5/4/2010 Tue
5 5/5/2010 Wed
6 5/6/2010 Thu
7 5/7/2010 Fri
8 5/8/2010 Sat
9 5/9/2010 Sun
10 5/10/2010 Mon
11 5/11/2010 Tue
12 5/12/2010 Wed
13 5/13/2010 Thu
14 5/14/2010 Fri
15 5/15/2010 Sat
16 5/16/2010 Sun
17 5/17/2010 Mon

--
Build a little, test a little.


"116" wrote:

Thanks Karl for the quick response. I can somewhat see whats going on here.
I do have it workig. I may have explained incorrectly.

We having company meeting on the first Weds of each month. So I trying to
get the posts between these 2 dates. When the next first Weds comes up, the
old posts will not display, so the posts beyond that Weds drop off the
results list.

David

"KARL DEWEY" wrote:

Create a table CountNumber with field CountNUM containing numbers 0 (zero)
through 6.

SELECT YourTable.*
FROM CountNumber, YourTable
WHERE ((([SomeDate]) Between (Date()-Day(Date())+1)+[CountNUM] And
(Date()-Day(Date())+1)+[CountNUM]-6) AND
((DatePart("w",(Date()-Day(Date())+1)+[CountNUM]))=4));

--
Build a little, test a little.


"116" wrote:

I am trying to create a query to give me the results from the first weds of
each month back to the following day after weds. Having trouble formatting
the Date function.

Any help would be greatly appriciated.

Thanks
David

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.