Year Only as Query Parameter

  • Thread starter Thread starter Kathy Webster
  • Start date Start date
K

Kathy Webster

I have an [InvoiceDate] field in a query. I want the user to be prompted to
enter the desired year they want matching records for. For example, if they
enter 2004, the query will return all records where the [InvoiceDate] is
between 1/1/2004 and 12/31/2004. How do I set this up as a parameter query?

Thank you,
Kathy
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PARAMETERS [Invoice Year?] Integer;
SELECT ...
FROM ...
WHERE InvoiceDate BETWEEN DateSerial([Invoice Year?],1,1)
AND DateSerial([Invoice Year?],12,31)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9gm34echKqOuFEgEQJeCwCgp8TW35pl8v/O9W9CUWcpNKCaDSgAoO8b
eelQ9imFvRYM+H1/OWCTnFgB
=Akl8
-----END PGP SIGNATURE-----
 
I have an [InvoiceDate] field in a query. I want the user to be prompted to
enter the desired year they want matching records for. For example, if they
enter 2004, the query will return all records where the [InvoiceDate] is
between 1/1/2004 and 12/31/2004. How do I set this up as a parameter query?

Thank you,
Kathy

Where Year([InvoiceDate]) = [Enter the year]
 
Thank you Fred! It is perfect!

fredg said:
I have an [InvoiceDate] field in a query. I want the user to be prompted
to
enter the desired year they want matching records for. For example, if
they
enter 2004, the query will return all records where the [InvoiceDate] is
between 1/1/2004 and 12/31/2004. How do I set this up as a parameter
query?

Thank you,
Kathy

Where Year([InvoiceDate]) = [Enter the year]
 
Perfect! Thanks so much!

fredg said:
I have an [InvoiceDate] field in a query. I want the user to be prompted
to
enter the desired year they want matching records for. For example, if
they
enter 2004, the query will return all records where the [InvoiceDate] is
between 1/1/2004 and 12/31/2004. How do I set this up as a parameter
query?

Thank you,
Kathy

Where Year([InvoiceDate]) = [Enter the year]
 

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

Back
Top