Query Criteria

  • Thread starter Thread starter Jeff F via AccessMonster.com
  • Start date Start date
J

Jeff F via AccessMonster.com

I have a number of various queries that I use for month end reporting. All
of them have various date specific criteria i.e., month start and end dates.
I want to be able to only enter the date info once rather than going into
each criteria and changing the dates or prompting everytime at runtime. I
thought of creating a small table with two fields startdate and enddate and
using them in the criteria but I get errors. Any help would be greatly
apprecieated. I do most of all my work in query design or sql view, I am a
complete novice at VBA.

Any help would be greatly appreciated.
 
Jeff said:
I have a number of various queries that I use for month end reporting. All
of them have various date specific criteria i.e., month start and end dates.
I want to be able to only enter the date info once rather than going into
each criteria and changing the dates or prompting everytime at runtime. I
thought of creating a small table with two fields startdate and enddate and
using them in the criteria but I get errors. Any help would be greatly
apprecieated. I do most of all my work in query design or sql view, I am a
complete novice at VBA.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Create an unbound form that will hold the start and end dates. Use form
references in the queries to get the dates. E.g.:

PARAMETERS Forms!FormName!StartDate Date, Forms!FormName!EndDate Date;
SELECT ...
FROM ...
WHERE date_column BETWEEN Forms!FormName!StartDate AND
Forms!FormName!EndDate

When you run the queries the form has to be open and the date fields
have to have valid dates.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQvPHDYechKqOuFEgEQLWSwCfeGZdzg6nz8AbWTJjO6V06Ln+QwEAnj5P
0OkQz6MkZxwse0Q7r7BC+rG9
=gXEv
-----END PGP SIGNATURE-----
 
Great. Thanks for the help
I have a number of various queries that I use for month end reporting. All
of them have various date specific criteria i.e., month start and end dates.
[quoted text clipped - 4 lines]
apprecieated. I do most of all my work in query design or sql view, I am a
complete novice at VBA.

Create an unbound form that will hold the start and end dates. Use form
references in the queries to get the dates. E.g.:

PARAMETERS Forms!FormName!StartDate Date, Forms!FormName!EndDate Date;
SELECT ...
FROM ...
WHERE date_column BETWEEN Forms!FormName!StartDate AND
Forms!FormName!EndDate

When you run the queries the form has to be open and the date fields
have to have valid dates.
 

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