By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Rules for multiline SQL statements

P: n/a
Can someone enlighten me on what the rules are for writing multiline
SQL statements in Access. Something regarding the numerous double
quotation marks and and underscores I see in multiline SQL code.

Thanks a lot for any help in advance.

May 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 17 May 2006 11:03:49 -0700, ca**********@hotmail.com wrote:
Can someone enlighten me on what the rules are for writing multiline
SQL statements in Access. Something regarding the numerous double
quotation marks and and underscores I see in multiline SQL code.

Thanks a lot for any help in advance.


An example would have been nice here, as there are times when the use
of double quotes has nothing to do with the fact that the SQL is
multi-line. Let's us answer your question, not the question we think
you are asking.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
May 17 '06 #2

P: n/a
I am getting confused between the use of different characters to
separate portions of a multiline SQL statement from one another and
characters used to enable strings to span multiple lines. Which of the
characters " or _ or & are used for what?

EXAMPLE OF TYPE 1: Example of multiline SQL:

strSqlPart1 = "SELECT tblOUMaster.[Serial Number],
tblOUMaster.EntryDate " & _
"FROM tblOUMaster WHERE (((tblOUMaster.[Serial Number])=" & """"

strSqlPart2 = """) AND ((tblOUMaster.EntryDate) Is Not Null));"

strSqlAll = strSqlPart1 & mySerialNumber & strSqlPart2
Need to select Serial Number and Entry Date from a table called
tblOUMaster where Serial Number is equal to mySerialNumber and Entry
Date is not null.

EXAMPLE OF TYPE 2: Example of string spanning multiple lines:

strMessage = "Enter the Date of Departure to be updated for Customer
Number " & _
Me.Customer_Number.Value & "."

The string variable strMessage will be used in a message box as
follows:

DateofDeparture = InputBox(strMessage, "Departure Date Entry
MessageBox")

May 17 '06 #3

P: n/a
Sorry about the mental block I had. I figured it out. Thanks for
replying Fred.

May 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.