Results 1 to 3 of 3
  1. #1
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167

    Query not returning records

    Hi,



    I have what I think is a simple query returning the names of students that have been dismissed since September 2012 using a "WithdrawnDate" field. The query pulls a lot of information from other related tables (about 6 different ones), and has two expressions.

    When the criteria is set to either "Is Not Null" or a date range (which is all I need), it does not return the complete set of records based on the data that fits the criteria in the main table?

    Any thoughts? Could there be some sort of join preventing all records from being returned?

    Thanks in advance.

    Daryl

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Date comparisons are 'a pain in the neck,' especially so in Access SQL. I suggest you first read Allen Browne's very good treatise on the subject.

    http://allenbrowne.com/ser-36.html

    If you are using start/end date parameter values by enclosing them in #s then the format must be mdy.

    If you are forcing your dates to be the internal numeric format using, say, CDate then the function expects the date to be in the format specified in the Windows Control Panel - not a good plan if you expect to port your db.

    Using 'Is Not Nul' may not be the best idea; try the Nz function instead.

    Can't help any more without seeing the code. Post as v2007 if you want my help specifically.

  3. #3
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Thanks Rod.

    I was away for away. I wasn't aware of the confusion dates may cause MS Access; the link was really helpful. I have run into a similair problem with use a combo box with a formatted date field in the record source. When I run the append query I get an "invalid entry" or it doesn't append or something else happens that I didn't expect.

    For my purposes I may change the dates to text...I'll have to think about this some more.

    Thanks so much for your reply.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query not returning records
    By Daryl2106 in forum Access
    Replies: 2
    Last Post: 11-28-2012, 09:29 AM
  2. Query Criteria not returning any records
    By SgtSaunders69 in forum Access
    Replies: 2
    Last Post: 12-19-2011, 07:45 PM
  3. Recordset not returning records
    By TinaCa in forum Programming
    Replies: 3
    Last Post: 08-03-2011, 09:26 AM
  4. Replies: 1
    Last Post: 05-19-2011, 10:55 PM
  5. Returning multiple records Isn't what I need
    By frobro390 in forum Queries
    Replies: 6
    Last Post: 09-21-2010, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums