Results 1 to 3 of 3

Thread: sSQL Problem

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Greenville, MS, Washington
    Posts
    38
    Why is this statement rejected?

    Code:
            sSQL = "SELECT * FROM EquipRunTime WHERE pond = '" & rsPonds!pond & "' " & _
            "(thedate BETWEEN #" & Format(DateAdd("h", -24, dtCurrent), "General Date") & "# AND #" & _
            Format(dtCurrent, "General Date") & "#)AND NOT Cleared ORDER BY thedate DESC"

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Give this a shot (you're definitely missng an and between the first condition and the second. I also tend to avoid exclamation points when accessing objects. It's not invalid, yet, but it is being phased out) :

    sSQL = "SELECT * FROM EquipRunTime WHERE pond = '" & rsPonds.pond & "' and " & _
    "(thedate BETWEEN #" & Format(DateAdd("h", -24, dtCurrent), "General Date") & "# AND #" & _
    Format(dtCurrent, "General Date") & "#)AND NOT Cleared ORDER BY thedate DESC"

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Greenville, MS, Washington
    Posts
    38
    Perfect! Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width