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  

Query criteria doesnt use year input



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2004, 08:34 PM
Donna Brooks
external usenet poster
 
Posts: n/a
Default Query criteria doesnt use year input

I have created a query in my HR database to pull all
employees due for their 90 day evaluation. Fields are as
follows: EmpNo
LastName
FirstName
HireDate
90Days: DateAdd("d",90,[HireDate])
I can run the query, calculates great. But, I need to
pull all employees, for examples, that the 90 Day is due
between 06/01/2004 and 06/30/2004, so in the criteria for
this expression, I use:
Between [Enter the first day of the month] and
[Enter the last day of the month]
It runs the query, but it pulls all employees with 90 Day
due in June regardless of the year. I need it to only
pull the ones with the year I specify. For example, I get
results like this, if my criteria were between 06/01/2004
and 06/30/2004.

525 John Doe 03/05/04 06/05/04
480 Jane Doe 03/08/01 06/08/01
592 Joe Blo 03/11/02 06/11/02

The only one that I need it to pull would be the first
one, the one in 2004.

Please help.
Thanks,
Donna Brooks


  #2  
Old May 28th, 2004, 09:00 PM
mate
external usenet poster
 
Posts: n/a
Default Query criteria doesnt use year input

First create a query that uses the datePart function to
extract the year and use 2004 in the criteria. Then use
your DateAdd query and base it on the datePart query. I
realize this is only a temporary fix as it will eventually
be 2005. but it should work for a little while at least.


-----Original Message-----
I have created a query in my HR database to pull all
employees due for their 90 day evaluation. Fields are as
follows: EmpNo
LastName
FirstName
HireDate
90Days: DateAdd("d",90,[HireDate])
I can run the query, calculates great. But, I need to
pull all employees, for examples, that the 90 Day is due
between 06/01/2004 and 06/30/2004, so in the criteria for
this expression, I use:
Between [Enter the first day of the month] and
[Enter the last day of the month]
It runs the query, but it pulls all employees with 90 Day
due in June regardless of the year. I need it to only
pull the ones with the year I specify. For example, I get
results like this, if my criteria were between 06/01/2004
and 06/30/2004.

525 John Doe 03/05/04 06/05/04
480 Jane Doe 03/08/01 06/08/01
592 Joe Blo 03/11/02 06/11/02

The only one that I need it to pull would be the first
one, the one in 2004.

Please help.
Thanks,
Donna Brooks


.

  #3  
Old May 28th, 2004, 10:19 PM
Ken Snell
external usenet poster
 
Posts: n/a
Default Query criteria doesnt use year input

Why not change your "parameter" prompts to these:

[Enter the starting date of the 90-day window:]

[Enter the ending date of the 90-day window:]


And then, when the parameter window is displayed, type in a full date:
6/1/2004.


--
Ken Snell
MS ACCESS MVP

"Donna Brooks" wrote in message
...
I have created a query in my HR database to pull all
employees due for their 90 day evaluation. Fields are as
follows: EmpNo
LastName
FirstName
HireDate
90Days: DateAdd("d",90,[HireDate])
I can run the query, calculates great. But, I need to
pull all employees, for examples, that the 90 Day is due
between 06/01/2004 and 06/30/2004, so in the criteria for
this expression, I use:
Between [Enter the first day of the month] and
[Enter the last day of the month]
It runs the query, but it pulls all employees with 90 Day
due in June regardless of the year. I need it to only
pull the ones with the year I specify. For example, I get
results like this, if my criteria were between 06/01/2004
and 06/30/2004.

525 John Doe 03/05/04 06/05/04
480 Jane Doe 03/08/01 06/08/01
592 Joe Blo 03/11/02 06/11/02

The only one that I need it to pull would be the first
one, the one in 2004.

Please help.
Thanks,
Donna Brooks




  #4  
Old May 29th, 2004, 03:57 AM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default Query criteria doesnt use year input

Perhaps you should post the full SQL String of the Query since the
parameters look OK.

--
HTH
Van T. Dinh
MVP (Access)





"Donna Brooks" wrote in message
...
I have created a query in my HR database to pull all
employees due for their 90 day evaluation. Fields are as
follows: EmpNo
LastName
FirstName
HireDate
90Days: DateAdd("d",90,[HireDate])
I can run the query, calculates great. But, I need to
pull all employees, for examples, that the 90 Day is due
between 06/01/2004 and 06/30/2004, so in the criteria for
this expression, I use:
Between [Enter the first day of the month] and
[Enter the last day of the month]
It runs the query, but it pulls all employees with 90 Day
due in June regardless of the year. I need it to only
pull the ones with the year I specify. For example, I get
results like this, if my criteria were between 06/01/2004
and 06/30/2004.

525 John Doe 03/05/04 06/05/04
480 Jane Doe 03/08/01 06/08/01
592 Joe Blo 03/11/02 06/11/02

The only one that I need it to pull would be the first
one, the one in 2004.

Please help.
Thanks,
Donna Brooks




 




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 10:31 PM.


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