Results 1 to 2 of 2
  1. #1
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199

    AND Operator in the Query


    I am using query

    SELECT tblDataentry.*
    FROM tblStaffs INNER JOIN tblDataentry ON tblStaffs.SL_No = tblDataentry.staffName
    WHERE (((Format([tblDataentry].[createdDate],"dd/mm/yyyy"))=Format(#6/10/2014#,"dd/mm/yyyy")) AND ((tblStaffs.SL_No)=31))
    ORDER BY tblDataentry.createdDate DESC;

    which is not showing any results, where as if i replace "AND" to "OR" or remove one condition it works, Please tell me how to make it work?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Looks okay offhand. Are you sure there's a record meeting both criteria? If you take out the SL_No criteria, does one of the records returned have 31 in that field?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Mathematical comparison operator in query
    By kazaccess in forum Queries
    Replies: 13
    Last Post: 07-22-2013, 01:25 AM
  2. Replies: 9
    Last Post: 01-22-2013, 04:23 PM
  3. Query Criteria Function and Operator List?
    By samanthaM in forum Access
    Replies: 2
    Last Post: 06-03-2012, 04:52 PM
  4. DateDiff Missing Operator? Long Query
    By ewassmer in forum Queries
    Replies: 1
    Last Post: 08-25-2011, 10:46 AM
  5. like operator in access query
    By mit in forum Access
    Replies: 3
    Last Post: 06-15-2011, 03:21 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