Date Query question

G

Guest

Hallo

I hope some one can help me

I have a query that has this as the criteria in the Date field:
=#12/05/2000# And <=#09/05/2001#

This database now has several years of data, regarding tax years. At the
moment I have several queries, one to cover each tax year.

Is there a way of having one query, with an input criteria of say, the year
2003, that will lookup all records for the next 365 days?
 
D

Douglas J. Steele

Not quite sure what you mean by "with an input criteria of say, the year
2003, that will lookup all records for the next 365 days?"

Are you saying that you want to allow the user to input 2003, and you'll
then extract all of the records for the year 2003?

BETWEEN DateSerial([WhatYear], 1, 1) AND DateSerial([WhatYear], 12, 31)
 
G

Guest

The user should enter the tax year 2003 but in the query should be then
=#12/05/2003# And <=#11/05/2004# as the tax year start 12th of May till the
11th of May the following year. At the moment i have a query for each year
and i would like only 1 query.

Markus

Douglas J. Steele said:
Not quite sure what you mean by "with an input criteria of say, the year
2003, that will lookup all records for the next 365 days?"

Are you saying that you want to allow the user to input 2003, and you'll
then extract all of the records for the year 2003?

BETWEEN DateSerial([WhatYear], 1, 1) AND DateSerial([WhatYear], 12, 31)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Markus said:
Hallo

I hope some one can help me

I have a query that has this as the criteria in the Date field:

This database now has several years of data, regarding tax years. At the
moment I have several queries, one to cover each tax year.

Is there a way of having one query, with an input criteria of say, the
year
2003, that will lookup all records for the next 365 days?
 
J

John Spencer (MVP)

Pardon me for jumping in, but all you need to do is modify what Douglas Steele
gave you.

Between DateSerial([What Year],5,12) and DateSerial([What year]+1,5,11)

You just put that in place of the criteria you are now using.
The user should enter the tax year 2003 but in the query should be then
=#12/05/2003# And <=#11/05/2004# as the tax year start 12th of May till the
11th of May the following year. At the moment i have a query for each year
and i would like only 1 query.

Markus

Douglas J. Steele said:
Not quite sure what you mean by "with an input criteria of say, the year
2003, that will lookup all records for the next 365 days?"

Are you saying that you want to allow the user to input 2003, and you'll
then extract all of the records for the year 2003?

BETWEEN DateSerial([WhatYear], 1, 1) AND DateSerial([WhatYear], 12, 31)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Markus said:
Hallo

I hope some one can help me

I have a query that has this as the criteria in the Date field:
=#12/05/2000# And <=#09/05/2001#

This database now has several years of data, regarding tax years. At the
moment I have several queries, one to cover each tax year.

Is there a way of having one query, with an input criteria of say, the
year
2003, that will lookup all records for the next 365 days?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top