Have you tried quoting the date?

-----Original Message-----
From: Ian Westbrook [mailto:[EMAIL PROTECTED]
Sent: 29 July 2003 15:16
To: cfug dev list
Subject: [ cf-dev ] syntax error...


Hi
been staring at this for half an hour now, and can't see what's wrong with
it. anyone else have an idea?

this is the query:

 <cfquery datasource="#dsn#" name="getdiary">
 SELECT diary.id AS diaryid, diary.directoryid, diary.artform AS
diaryartform, diary.*, directory.id AS directoryid, directory.fullname,
directory.town, towns.id AS townid, towns.town AS town
 FROM diary, directory, towns
 WHERE diary.directoryid = directory.id
 AND directory.town = towns.id 
 <cfif form.town IS NOT 'all'>
 AND directory.town = #form.town# 
 </cfif>
 <cfif form.artform IS NOT 'all'>
 AND diary.artform = #form.artform#
 </cfif>
 AND
 (( diary.startdate >= #session.searchdatestart#)
 OR
 ( diary.enddate >= #session.searchdatestart#))
 AND diary.publish = 'yes'
 ORDER BY diary.startdate, diary.enddate, diary.title
 </cfquery>

this is the error message:

ODBC Error Code = 37000 (Syntax error or access violation) 


[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'diary.directoryid = directory.id AND directory.town =
towns.id AND directory.town = 116 AND diary.artform = 10 AND ((
diary.startdate >= Tuesday July 29, 2003) OR ( diary.enddate >= Tuesday July
29, 2003))'. 


SQL = "SELECT diary.id AS diaryid, diary.directoryid, diary.artform AS
diaryartform, diary.*, directory.id AS directoryid, directory.fullname,
directory.town, towns.id AS townid, towns.town AS town FROM diary,
directory, towns WHERE diary.directoryid = directory.id AND directory.town =
towns.id AND directory.town = 116 AND diary.artform = 10 AND ((
diary.startdate >= Tuesday July 29, 2003) OR ( diary.enddate >= Tuesday July
29, 2003)) ORDER BY diary.startdate, diary.enddate, diary.title"

it doesn't seem to be seeing the WHERE in front of 'diary.directoryid =
directory.id', but I'll be buggered if I can see why. maybe a fresh pair of
eyes can spot it?

TIA

Ian W

Ian Westbrook,
FutureDream Media Limited,
(W): www.futuredream.net
(E): [EMAIL PROTECTED]
(T): +44 (0) 1303 258 985
(M): 07939 510 812

This message may contain information which is legally privileged and/or
confidential. If you are not the intended recipient, you are hereby notified
that any unauthorised disclosure, copying, distribution or use of this
information is strictly prohibited. Such notification notwithstanding any
comments, opinions, information or conclusions expressed in this message are
those of the originator, not of FutureDream Media Ltd, unless otherwise
explicitly and independently indicated by an authorised representative of
FutureDream Media Ltd.
DISCLAIMER: This e-mail is confidential and may also be legally privileged.
If you are not the intended recipient, use of the information contained in
this e-mail (including disclosure, copying or distribution) is prohibited
and may be unlawful.  Please inform the sender and delete the message
immediately from your system.  This e-mail is attributed to the sender and
may not necessarily reflect the views of the patsystems Group and no member
of the patsystems Group accepts any liability for any action taken in
reliance on the contents of this e-mail (other than where it has a legal or
regulatory obligation to do so) or for the consequences of any computer
viruses which may have been transmitted by this e-mail. The patsystems Group
comprises patsystems plc and its subsidiary group of companies.

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to