469,090 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,090 developers. It's quick & easy.

Syntax Error

lotus18
866 512MB
Can you spot the syntax error? When I try to use this it says "Syntax error (missing operator) in query expression"

Expand|Select|Wrap|Line Numbers
  1. Dim strSQL$
  2. strSQL = "SELECT * FROM LoadSchedule WHERE " & _
  3.                     "(DayA = '" & Day1 & _
  4.                      "' AND Rooms.Title = '" & Room & _
  5.                      "' AND Courses.Title = '" & Course & _
  6.                      "' AND Sections.Title = '" & Section & _
  7.                      "' AND Semester = '" & Semester & _
  8.                      "' AND ((TimeStarted <= #" & TimeStarted & "#" & _
  9.                      "  AND TimeFinished => #" & TimeStarted & "#)" & _
  10.                      "  OR (TimeStarted => #" & TimeStarted & "#" & _
  11.                      "  AND TimeSTARTED =< #" & TimeFinished & "#)))" & _
  12.                      " OR " & _
  13.                      "(DayB = '" & Day2 & _
  14.                      "' AND Rooms.Title = '" & Room & _
  15.                      "' AND Courses.Title = '" & Course & _
  16.                      "' AND Sections.Title = '" & Section & _
  17.                      "' AND Semester = '" & Semester & _
  18.                      "' AND ((TimeStarted <= #" & TimeStarted & "#" & _
  19.                      "  AND TimeFinished => #" & TimeStarted & "#)" & _
  20.                      "  OR (TimeStarted => #" & TimeStarted & "#" & _
  21.                      "  AND Timestarted =< #" & TimeFinished & "#)))"
  22.  
  23.         adRecordset.Open strSQL, dbConnection, 1, 1
Dec 8 '07 #1
4 795
Killer42
8,435 Expert 8TB
Is it possible that it doesn't like the operator "=>"? I've always used ">=" but don't know whether it matters.

In any case, I'd recommend you print out the actual value of strSQL and paste it here for us to see.
Dec 10 '07 #2
CyberSoftHari
487 Expert 256MB
Killer is correct the query string will not validate => (equal or greater), It should be >= (Greater or equal) and as well =<.
Dec 10 '07 #3
lotus18
866 512MB
Hi

I think you're right. Thanks. LOL

Rey Sean
Dec 10 '07 #4
Killer42
8,435 Expert 8TB
Let us know how it turns out.
Dec 10 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Steve | last post: by
1 post views Thread by Donald Canton | last post: by
3 posts views Thread by Manuel | last post: by
1 post views Thread by Hari Sekhon | last post: by
7 posts views Thread by Josh | last post: by
Banfa
5 posts views Thread by Banfa | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.