Re: SQL syntax
- From: "Al Reid" <areidjr@xxxxxxxxxxxxxxxx>
- Date: Tue, 5 May 2009 15:04:47 -0400
"Edward" <nospam@xxxxxxxx> wrote in message
news:MT%Ll.47552$ew.38144@xxxxxxxxxxxxxxx
"Al Reid" <areidjr@xxxxxxxxxxxxxxxx> wrote in message
news:ekTg2wazJHA.1432@xxxxxxxxxxxxxxxxxxxxxxx
InlineI cant see the extra set of double quotes, I copied & pasted this in
"Edward" <nospam@xxxxxxxx> wrote in message
news:GC_Ll.14500$BZ3.2656@xxxxxxxxxxxxxxx
"argusy" <argusy@xxxxxxxxxxxxxxx> wrote in message
news:001bf068$0$9685$c3e8da3@xxxxxxxxxxxxxxxxxxxx
Ralph wrote:
I agree with Ralph totally on that.I was able to get it to work late last night with:
"WHERE 'tblOpenEvents.Bit_No' = ' Bit ' AND ' tblOpenEvents.Bank_No
' =
' Bank ' "
Thanks for your time.
I wish I could find detailed info on SQL syntax and standards, I've
struggled with these forever.
Google using the search string "sql reference tutorial" and take your
pick.
You will need a good book. Actually you will likely end up with at
least
three - one a good generally introductionary guide to "Learning SQL",
a
"Reference Manual", and then one specifically for the RDBMS you are
using.
What is seldom appreciated by programmers when they first encounter
SQL is
that it is a "programming language" in itself - declarative not
procedural -
but a language none the less. It has clauses (blocks) and conditionals
to
produce a result. Just like any programming language it takes time to
learn.
Save yourself endless grief and take some time to learn it.
-ralph
Your above "WHERE..." .
That would work without producing an error, but do you get any records
returned?
Graham
No it failed afterall.
My current endeavor is a Delete selected records SQL using 3 variables
as follows:
strSQLc = "DELETE tblOpenEvents.Bit_No, tblOpenEvents.Bank_No,
tblOpenEvents.Card_No " & _
"FROM tblOpenEvents " & _
In the following line there is an extra double quote before the
tblOpenEvents...
"WHERE tblOpenEvents.Bit_No = " & Bit &" AND "tblOpenEvents.Bank_No =
" & Bank &" And "tblOpenEvents.Card_No = " & Card
Using the " character as in the above suggestion produces the
'Expected: End Of Statement' error just after leaving the SQL string
with the cursor, highlighted on the first AND.
I'm looking for a comprehensive guide to SQL syntax, but what I'm
finding is vague, general, and not providing diverse critical accurate
examples of using variables. I'm still looking.
notepad with a larger font. Can you be more specific?
the line (watch for line wrap)
"WHERE tblOpenEvents.Bit_No = " & Bit &" AND "tblOpenEvents.Bank_No = " &
Bank &" And "tblOpenEvents.Card_No " & Card
should be:
"WHERE tblOpenEvents.Bit_No = " & Bit & " AND tblOpenEvents.Bank_No = " &
Bank & " And tblOpenEvents.Card_No " & Card
There were extra quotes before both instances of tblOpenEvents
I hope this helps.
--
Al Reid
.
- Follow-Ups:
- Re: SQL syntax
- From: Edward
- Re: SQL syntax
- References:
- SQL syntax
- From: Edward
- Re: SQL syntax
- From: Jason Keats
- Re: SQL syntax
- From: Edward
- Re: SQL syntax
- From: argusy
- Re: SQL syntax
- From: Edward
- Re: SQL syntax
- From: argusy
- Re: SQL syntax
- From: Edward
- Re: SQL syntax
- From: argusy
- Re: SQL syntax
- From: Edward
- Re: SQL syntax
- From: Ralph
- Re: SQL syntax
- From: argusy
- Re: SQL syntax
- From: Edward
- Re: SQL syntax
- From: Al Reid
- Re: SQL syntax
- From: Edward
- SQL syntax
- Prev by Date: Re: SQL syntax
- Next by Date: Re: SQL syntax
- Previous by thread: Re: SQL syntax
- Next by thread: Re: SQL syntax
- Index(es):
Relevant Pages
|