Results 1 to 4 of 4
  1. #1
    Join Date
    May 2014
    Posts
    98

    Unanswered: Query Generating different results

    If I use this query I get the results what I want
    SELECT tblMainTWTTPSheet.txtRootCause, Count(tblMainTWTTPSheet.txtRootCause) AS CountOftxtRootCause
    FROM tblMainTWTTPSheet
    GROUP BY tblMainTWTTPSheet.txtRootCause
    HAVING (((tblMainTWTTPSheet.txtRootCause) Is Not Null) AND ((Count(tblMainTWTTPSheet.txtRootCause)) Is Not Null))
    ORDER BY Count(tblMainTWTTPSheet.txtRootCause) DESC;

    But What I am trying to do is on a form select dates and generate data in this query. which doesnot happen even if I use the following query. Can anybody help me what wrong I am doing.

    SELECT tblMainTWTTPSheet.txtRootCause, Count(tblMainTWTTPSheet.txtRootCause) AS CountOftxtRootCause
    FROM tblMainTWTTPSheet
    WHERE (((tblMainTWTTPSheet.date) Between [Forms]![frmStratificationOfRootCauses]![startDate] And [Forms]![frmStratificationOfRootCauses]![endDate]))
    GROUP BY tblMainTWTTPSheet.txtRootCause
    HAVING (((tblMainTWTTPSheet.txtRootCause) Is Not Null) AND ((Count(tblMainTWTTPSheet.txtRootCause)) Is Not Null));

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    What does the second query return?
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    May 2014
    Posts
    98
    It returns nothing

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    Hmm. It's been a while since I tried working on a query that takes selection criteria directly from a form, but try enclosing the form expressions in hash symbols (#).
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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