Reply to Re: Help needed with query syntax

Your name:

Reply:


Posted by Michael B. Johnson on 09/25/33 11:33

On Wed, 30 Nov 2005 15:46:11 +0100, "T. Wintershoven" <wintershoven@quicknet.nl>
wrote:

>Can someone please tell me whats wrong with the last line of the query
>below. The first three lines work fine but when i add the fourth line i get
>an error message (see text at ERROR MESSAGE)
>
> sql_HTTermijnRecords = "select * from Orders where FaktuurGeprint =
>'J'" & _
> "AND dathergestuurd Is Not Null " & _
> "AND PerBankKas Is Null " & _
> "AND " & HTdatumMinAantalDagen & " > " & dathergestuurd
>
>The last line is a comparison between two dates.
>
>ERROR MESSAGE
>============================================
>Run-time error 3075
>
>Syntax error (missing operator) in query expression 'FaktuurGeprint =
>'J' AND dathergestuurd Is Not Null AND PerBankKas Is Null AND
>22-11-2005 >'
>
>========= end error message==============================

>What is wrong with the syntax of the last line ???

If you are sure the Date in [HTdatumMinAantalDagen] and the Date in
[dathergestuurd] are not NULL, then you need to use single quotes. -

SELECT *
FROM Orders
WHERE FaktuurGeprint = 'J'
AND dathergestuurd Is Not Null
AND PerBankKas Is Null

Last line needs to be like this:

.... & " AND '" & HTdatumMinAantalDagen & "' > '" & dathergestuurd & "'"
-- Please note the additional ' within the "" quotes!

Hope this helps!
_______________________
Michael B. Johnson

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация