Text Concatenation Problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Mr. Hookom's Concatenate function, and am having trouble inputting
the SQL syntax correctly. Here is what I have done thus far:

SELECT qryConvertLtrToNumber.Course, concatenate("SELECT C14 FROM
qryConvertLtrToNumber WHERE (Course =" & """ & [Course] & """ & ") AND (" &
""" & [N13] & """ & "=4)","~ ") AS C14, concatenate("SELECT C15 FROM
qryConvertLtrToNumber WHERE Course = """ & [Course] & """","~ ") AS C15
FROM qryConvertLtrToNumber
GROUP BY qryConvertLtrToNumber.Course;

The C15 expression works as expected, the C14 expression does not (empty
fields). What I believe I want, in straight SQL is:

SELECT C14 FROM qryConvertLtrToNumber WHERE (Course = [Course] ) AND ([N09]
=4)

I am stuck. Perhaps it's bad SQL syntax, perhaps its poor concatenating,
perhaps both. Any help appreciated.
 
John said:
I am using Mr. Hookom's Concatenate function, and am having trouble inputting
the SQL syntax correctly. Here is what I have done thus far:

SELECT qryConvertLtrToNumber.Course, concatenate("SELECT C14 FROM
qryConvertLtrToNumber WHERE (Course =" & """ & [Course] & """ & ") AND (" &
""" & [N13] & """ & "=4)","~ ") AS C14, concatenate("SELECT C15 FROM
qryConvertLtrToNumber WHERE Course = """ & [Course] & """","~ ") AS C15
FROM qryConvertLtrToNumber
GROUP BY qryConvertLtrToNumber.Course;

The C15 expression works as expected, the C14 expression does not (empty
fields). What I believe I want, in straight SQL is:

SELECT C14 FROM qryConvertLtrToNumber WHERE (Course = [Course] ) AND ([N09]
=4)

I am stuck. Perhaps it's bad SQL syntax, perhaps its poor concatenating,
perhaps both. Any help appreciated.


Your quotes are all mixed up:

Concatenate("SELECT C14 FROM qryConvertLtrToNumber WHERE
(Course =""" & [Course] & """) AND (N13=4)", "~ ")
 
I was making it WAY too hard. Thanks.

Marshall Barton said:
John said:
I am using Mr. Hookom's Concatenate function, and am having trouble inputting
the SQL syntax correctly. Here is what I have done thus far:

SELECT qryConvertLtrToNumber.Course, concatenate("SELECT C14 FROM
qryConvertLtrToNumber WHERE (Course =" & """ & [Course] & """ & ") AND (" &
""" & [N13] & """ & "=4)","~ ") AS C14, concatenate("SELECT C15 FROM
qryConvertLtrToNumber WHERE Course = """ & [Course] & """","~ ") AS C15
FROM qryConvertLtrToNumber
GROUP BY qryConvertLtrToNumber.Course;

The C15 expression works as expected, the C14 expression does not (empty
fields). What I believe I want, in straight SQL is:

SELECT C14 FROM qryConvertLtrToNumber WHERE (Course = [Course] ) AND ([N09]
=4)

I am stuck. Perhaps it's bad SQL syntax, perhaps its poor concatenating,
perhaps both. Any help appreciated.


Your quotes are all mixed up:

Concatenate("SELECT C14 FROM qryConvertLtrToNumber WHERE
(Course =""" & [Course] & """) AND (N13=4)", "~ ")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top