don't you need ' ' around your date string?  i.e. instead of
diary.startdate >= Tuesday July 29, 2003
it should say
diary.startdate >= 'Tuesday July 29, 2003'


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


                                                                                       
                            
                    "Ian                                                               
                            
                    Westbrook"           To:     "cfug dev list" <[EMAIL PROTECTED]>   
                  
                    <[EMAIL PROTECTED]        cc:                                      
                                 
                    eam.net>             Subject:     [ cf-dev ] syntax error...       
                            
                                                                                       
                            
                    29/07/2003                                                         
                            
                    15:16                                                              
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    dev                                                                
                            
                                                                                       
                            
                                                                                       
                            



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.





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