Problem with >= AND < in Access

Results 1 to 2 of 2

Thread: Problem with >= AND < in Access

  1. #1
    Join Date
    Dec 1969
    Posts
    1,324

    Default Problem with >= AND < in Access

    Hi folks,<BR><BR>I&#039ve been trying a piece of code that should work, but is mystifying me. My SQL is<BR>SELECT * FROM DateInfo WHERE (EntryDate >= 1999-05-29 and EntryDate &#060; 1999-06-12); <BR><BR>I&#039ve also tried<BR>SELECT * FROM DateInfo WHERE (EntryDate BETWEEN 1999-05-29 and 1999-06-12); <BR><BR>Neither of them work however. Doing a >= on it&#039s own returns me all the data I would expect it to, whilst a &#060; on it&#039s own returns absolutely nothing! I&#039m stumped now - any of you guys got any bright ideas?

  2. #2
    Join Date
    Dec 1969
    Posts
    1,324

    Default SOLVED!

    OK, the problem appear to be that Access wants me to use SQL based dates and times, so I&#039ve used the following instead -<BR><BR>SQL = "SELECT * FROM DateInfo WHERE EntryDate >= (NOW - " & MinusAmount & ") AND EntryDate &#060; (NOW + " & PlusAmount & ");"<BR><BR>and that (as they say) is that!

Posting Permissions

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