Posted by Michael B. Johnson on 10/22/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
Navigation:
[Reply to this message]
|