current year

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

Guest

I can't seem to find the right solution for this. I simply need to revise
this to query the current year:

SELECT tblComplaints.DateReceived, tblComplaints.PrimaryReason,
tblComplaints.ProductionFacility
FROM tblComplaints
WHERE
(((tblComplaints.ProductionFacility)=[Forms]![frmComplaintQueriesReports]![cbFacility])) OR ((([Forms]![frmComplaintQueriesReports]![cbFacility]) Is Null))
ORDER BY tblComplaints.PrimaryReason;

[DateReceived] is the field I need to set the criteria for but nothing seems
to be working.

I appreciate your help!
 
SELECT tblComplaints.DateReceived, tblComplaints.PrimaryReason,
tblComplaints.ProductionFacility
FROM tblComplaints
WHERE
(ProductionFacility=[Forms]![frmComplaintQueriesReports]![cbFacility] OR
[Forms]![frmComplaintQueriesReports]![cbFacility] Is Null)
AND Year(DateReceived) = Year(Date())
ORDER BY tblComplaints.PrimaryReason;
 
Thanks, Duane! Very simple. I was getting really confused by some of the
other examples here!
--
www.Marzetti.com


Duane Hookom said:
SELECT tblComplaints.DateReceived, tblComplaints.PrimaryReason,
tblComplaints.ProductionFacility
FROM tblComplaints
WHERE
(ProductionFacility=[Forms]![frmComplaintQueriesReports]![cbFacility] OR
[Forms]![frmComplaintQueriesReports]![cbFacility] Is Null)
AND Year(DateReceived) = Year(Date())
ORDER BY tblComplaints.PrimaryReason;


--
Duane Hookom
Microsoft Access MVP


JohnLute said:
I can't seem to find the right solution for this. I simply need to revise
this to query the current year:

SELECT tblComplaints.DateReceived, tblComplaints.PrimaryReason,
tblComplaints.ProductionFacility
FROM tblComplaints
WHERE
(((tblComplaints.ProductionFacility)=[Forms]![frmComplaintQueriesReports]![cbFacility])) OR ((([Forms]![frmComplaintQueriesReports]![cbFacility]) Is Null))
ORDER BY tblComplaints.PrimaryReason;

[DateReceived] is the field I need to set the criteria for but nothing seems
to be working.

I appreciate your help!
 
Back
Top