Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

access date query criteria

Posted on 2011-02-28
4
Medium Priority
?
417 Views
Last Modified: 2012-05-11
Mental block over query criteria:

I have a sales date field [date of sale] and I want separate criteria for two separate queries.

The first query is " which clients have placed a sale in the last 30 days" by reference to clients records

The other is message box "those clients which sales since have taken place since [insert date]"

Each client has its own record. the two queries are stand alone.

Just need the criteria for the date field query.

0
Comment
Question by:topUKlawyer
  • 2
  • 2
4 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 35004645
The first query needs to be a groupby/totals query.  Just needs Customer name  and Date of sale fields.
Group By customer name and get Max of date of sale.
Set the criteria on the Date of sale column to
>Date()-31

Secod query is the same as the first except the criteria is :
>[Enter date]
You should declare [Enter Date] in the query parameters as a datetime datatype to prevent invalid dates being entered.
0
 

Author Comment

by:topUKlawyer
ID: 35004792
Thanks.

Not sure where this is declared/entered:

You should declare [Enter Date] in the query parameters as a datetime datatype to prevent invalid dates being entered.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 35004986
In query design view choose Query>Parameters from the menu.
0
 

Author Comment

by:topUKlawyer
ID: 35010853
many thanks. esp the parameters point which i had not come across before.

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question