Several Queries, Enter date every time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have several queries that run off the same date (mmm-yy format). How can I
enter the date one time instead of several times?

Also, I need to build a query that will take the date mentioned above and
add the previous 11 months of data. I was able to build the query where the
user is prompted for the between dates but it was kind of confusing. It
asked the user for the current month this year and the current month last
year. I was wondering if there was a way to enter the month one time and all
the queries feed off of that.
 
Create a form with unbound textbox to enter your criteria. Use it for your
queries like --
[Forms]![YourForm]![YourTextBox]

For a years data use between the above and --
DateAdd("y",-1,[Forms]![YourForm]![YourTextBox])
 
I can't seem to get the form to link to the query. Here is the sql from the
query.

SELECT DISTINCTROW Charges.[Billins Address Subgroup], Charges.Date,
Charges.Charges
FROM Charges
WHERE (((Charges.Date)=[Forms]![Test-Unbound]![Text0]));

I get nothing back.

KARL DEWEY said:
Create a form with unbound textbox to enter your criteria. Use it for your
queries like --
[Forms]![YourForm]![YourTextBox]

For a years data use between the above and --
DateAdd("y",-1,[Forms]![YourForm]![YourTextBox])

Cortney said:
I have several queries that run off the same date (mmm-yy format). How can I
enter the date one time instead of several times?

Also, I need to build a query that will take the date mentioned above and
add the previous 11 months of data. I was able to build the query where the
user is prompted for the between dates but it was kind of confusing. It
asked the user for the current month this year and the current month last
year. I was wondering if there was a way to enter the month one time and all
the queries feed off of that.
 
I tried it on all my other queries and it worked so it something to do with
that one. I am checking how that table is set up to try and figure it out.

KARL DEWEY said:
Create a form with unbound textbox to enter your criteria. Use it for your
queries like --
[Forms]![YourForm]![YourTextBox]

For a years data use between the above and --
DateAdd("y",-1,[Forms]![YourForm]![YourTextBox])

Cortney said:
I have several queries that run off the same date (mmm-yy format). How can I
enter the date one time instead of several times?

Also, I need to build a query that will take the date mentioned above and
add the previous 11 months of data. I was able to build the query where the
user is prompted for the between dates but it was kind of confusing. It
asked the user for the current month this year and the current month last
year. I was wondering if there was a way to enter the month one time and all
the queries feed off of that.
 
Back
Top