Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query not returning results (2000)

    Hi,
    Here's a query I have for a report in SQL view:

    SELECT TblMain.*, QryPayments.*, QryPayments.Actual, Nz(Month([QryPayments.DateTime]),1) AS Expr2
    FROM QryPayments INNER JOIN TblMain ON QryPayments.URN = TblMain.URN
    WHERE (((QryPayments.Actual) Is Not Null) AND ((Nz(Month([QryPayments.DateTime]),1))=[Forms]![FrmReports]![CboMonth]) AND ((QryPayments.NOFF)=False) AND ((Nz(Year([QryPayments.DateTime]),1999))=[Forms]![FrmReports]![CboYear]))
    WITH OWNERACCESS OPTION;

    I have a field in QryPayments called DateTime that I'd like to filter dependant upon the values in FrmReport CboYear & CboMonth, but the query is returning no values. I've had a peruse and as far as I can tell there are no problems..................am I missing something?

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

    Re: Query not returning results (2000)

    Apparently there are no records that satisfy all four conditions. Try the following:
    - Open the form frmReports and select a month and year for which you are certain there should be records.
    - Open the query in design view
    - Remove one of the conditions.
    - Without saving the query, switch to datasheet view.
    - If you do get records now, you know that the removed condition was problematic.
    - Otherwise, close the query without saving.
    - Reopen in design view, and repeat with another condition.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query not returning results (2000)

    Thanks Hans, I have discovered the fault............................................. .

Posting Permissions

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