Solved

access date query criteria

Posted on 2011-02-28
4
410 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

710 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