Solved

access date query criteria

Posted on 2011-02-28
4
400 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 500 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

789 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