Re: SQL syntax

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Edward" <nospam@xxxxxxxx> wrote in message
news:MT%Ll.47552$ew.38144@xxxxxxxxxxxxxxx
"Al Reid" <areidjr@xxxxxxxxxxxxxxxx> wrote in message
news:ekTg2wazJHA.1432@xxxxxxxxxxxxxxxxxxxxxxx
Inline

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


I agree with Ralph totally on that.

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.


I cant see the extra set of double quotes, I copied & pasted this in
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


.



Relevant Pages

  • Re: attribute name conflicts
    ... but I think the "user types" you are referring to are the ... The SQL Syntax ... The first relational DBMS I dealt with, ...
    (comp.databases.theory)
  • Re: SQL syntax translations?
    ... I take it the issue is that you are moving from Access/Jet to SQL ... Access/Jet become a lot more complicated when you try to make them SQL ... the data comes from linked ODBC tables so the sql syntax is ... I cant just copy over the code from my access queries into the ...
    (microsoft.public.data.odbc)
  • Re: Valid SQL?
    ... Does anyone see anything wrong with this SQL syntax? ... Unless it's an RDBMS scheme for surrounding column or table-names that might have spaces in them (or might be SQL keywords). ... Lastly, you don't include the text of the error message that you're getting back...most error messages try to be helpful, and in this case, it would certainly be helpful. ...
    (comp.lang.python)
  • Re: SQL syntax
    ... I wish I could find detailed info on SQL syntax and standards, ... Just like any programming language it takes time to ... There were extra quotes before both instances of tblOpenEvents ...
    (microsoft.public.vb.database)
  • Re: ALTER (or CREATE) TABLE/Ole Object Data Type in MS Access
    ... "Ole Object" data type, but I need to be able to do it using SQL syntax ... My database is an Access 2003 database, and the SQL ... ADOX is an "extension" to ADO intended for creating/modifying schema and security. ...
    (microsoft.public.vb.general.discussion)