Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Query - several criteria (Access 2003)

    In the Query below I want to ask two questions in the Field "ReviewDue". I am looking for the dates overdue from today AND where this field is blank and has no date entered at all.

    Can anyone help me?

    SELECT tbl_Applications.Surname, tbl_Applications.StaffName, tbl_Applications.Given, tbl_Applications.DCSID, tbl_Applications.Status, tbl_Applications.ProjectID, tbl_Applications.FMDNO, tbl_Applications.TransmitterNo, lup_Criteria.Criteria, tbl_Applications.Institution, tbl_Applications.ReviewNotes, tbl_Applications.ReviewDue, tbl_Applications.ElectronicsClause, tbl_Applications.TypeHD, tbl_Applications.StartDates, tbl_Applications.EndDates, tbl_Applications.SupervisionStandard
    FROM tbl_Staff RIGHT JOIN (lup_Criteria INNER JOIN tbl_Applications ON lup_Criteria.CriteriaID = tbl_Applications.CriteriaID) ON tbl_Staff.StaffID = tbl_Applications.ReportWriter
    WHERE (((tbl_Applications.Status)="active") AND ((lup_Criteria.Criteria)="caseload" Or (lup_Criteria.Criteria)="AWOL/In Custody/UAL") AND ((tbl_Applications.ReviewDue)<Now()) AND ((tbl_Applications.Region)="WMR")) OR (((tbl_Applications.Region)="NMR"));

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query - several criteria (Access 2003)

    Try this version:

    SELECT tbl_Applications.Surname, tbl_Applications.StaffName, tbl_Applications.Given, tbl_Applications.DCSID, tbl_Applications.Status, tbl_Applications.ProjectID, tbl_Applications.FMDNO, tbl_Applications.TransmitterNo, lup_Criteria.Criteria, tbl_Applications.Institution, tbl_Applications.ReviewNotes, tbl_Applications.ReviewDue, tbl_Applications.ElectronicsClause, tbl_Applications.TypeHD, tbl_Applications.StartDates, tbl_Applications.EndDates, tbl_Applications.SupervisionStandard
    FROM tbl_Staff RIGHT JOIN (lup_Criteria INNER JOIN tbl_Applications ON lup_Criteria.CriteriaID = tbl_Applications.CriteriaID) ON tbl_Staff.StaffID = tbl_Applications.ReportWriter
    WHERE (((tbl_Applications.Status)="active") AND ((lup_Criteria.Criteria)="caseload" OR (lup_Criteria.Criteria)="AWOL/In Custody/UAL") AND (((tbl_Applications.ReviewDue)<Now()) OR ((tbl_Applications.ReviewDue) Is Null)) AND ((tbl_Applications.Region)="WMR")) OR (((tbl_Applications.Region)="NMR"));

  3. #3
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: Query - several criteria (Access 2003)

    Duh! I feel like a right twit! I tried the is null stuff but not Or. Must be too late in the day for my brain.

    Thanks Hans.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query - several criteria (Access 2003)

    It's still early here! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •