473,394 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 843
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

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

Similar topics

1
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. ...
1
by: Donald Canton | last post by:
Hi, I'm using Bjarne's book to learn C++ and am stuck on the Calc program in Section 6. Everything works fine except when I try to use istringstream to parse a token from the command line. I...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
2
by: david | last post by:
Anyone could give me a hand about this syntax error? Thank you. David Source Code: Dim conn As New SqlConnection(strConn) Dim daAngio As New SqlDataAdapter(strSelectStatement, conn) 'Create a...
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
1
by: Hari Sekhon | last post by:
I've written an except hook into a script as shown below which works well for the most part and catches exceptions. import sys def myexcepthook(type,value,tb): do something ...
7
by: Josh | last post by:
I have a lot of except Exception, e statements in my code, which poses some problems. One of the biggest is whenever I refactor even the triviallest thing in my code. I would like python to...
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
6
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
5
Banfa
by: Banfa | last post by:
So I have a little problem, I have a template class and that class contains a template function; now what I want to do is declare that function in the class (or indeed the entire class) as a friend...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.