Sql syntax

Mcgrco

Registered User.
Local time
Today, 13:56
Joined
Jun 19, 2001
Messages
118
Im trying to put some sql together and I can seem to get the syntax correct

Im trying to query a field where the records are not equal to "" (empty string)

How do i put "" in sql code
heres my example
sSql = sSql & " AND [tbl 03 all positions].Exception <>" & Chr$(34) & Chr$(34) and below is the full sql statement

Can anyone help

sSql = sSql & " "
sSql = sSql & " SELECT [tbl 03 all positions].Exception"
sSql = sSql & " FROM [tbl 03 all positions]"
sSql = sSql & " WHERE [tbl 03 all positions].[Instrument Type]=chr$(34)& CFD & chr$(34)"
sSql = sSql & " AND [tbl 03 all positions].Exception <>" & Chr$(34) & Chr$(34)
sSql = sSql & " AND [tbl 03 all positions].[Notional 1]<>0;"
 
How do i put "" in sql code
You write a single quote the following way: """". So "" is """" & """".
Eventually define a constant: Quotes

sSql = sSql & " AND [tbl 03 all positions].Exception <>" & Quotes & Quotes & Chr$(34) & Chr$(34)

Alex

[This message has been edited by Alexandre (edited 02-27-2002).]

[This message has been edited by Alexandre (edited 02-27-2002).]
 

Users who are viewing this thread

Back
Top Bottom