criteria HELP!!!!!!!!!!!!!!!!!!!!!

  • Thread starter Thread starter jacksons
  • Start date Start date
J

jacksons

Hello,
I've created three tables for the sales of a company and now i'm
trying to run a query that only takes the sales after the month of january,
the expression Builder was no help Please Advise
Thanks
 
I use this criteria in my date fields to pick the dates I want to include.
the "Like ..." part shows up on the message to show a user the format they
should use.

Between [Start Date "Like MM/DD/YY"] And [End Date "Like MM/DD/YY"]

Rich
 
In query design view put Month([SaleDate]) in the 'field' row of a blank
column (where SaleDate is the name of a field in the relevant table), uncheck
the 'show' checkbox and in the 'criteria' row put >1.

That will return all rows where the month is other than January. If the
data spans several years you'll get rows for each year of course, so if for
instance you want to restrict the results to the current year do the same in
another column, this time using Year[SaleDate]) and a criterion of
Year(Date()).

This would translate to a WHERE clause for the query of:

WHERE MONTH([SaleDate]) > 1 AND YEAR([SaleDate]) = YEAR(DATE())

Ken Sheridan
Stafford, England
 
Back
Top