Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL question 1

Status
Not open for further replies.

jommyjet

Technical User
May 19, 2003
49
US
I'm stringing together a SQL statement in a loop that defines the new statement each time as
strSQL = strSQL & ",[summaryFTEconfirmed].[countof" & strTEMP & "] As confirmed" & strTEMP & ",[summaryFTEnamed].[countof" & strTEMP & "]"
I can't add an AS clause to the second part without an error that I'm using a reserved word which I assume is AS. I may be missing a delimiter from this
strSQL = strSQL & ",[summaryFTEconfirmed].[countof" & strTEMP & "] As confirmed" & strTEMP & ",[summaryFTEnamed].[countof" & strTEMP & "]" & "AS named " & strTEMP
thanks
 
The As clause in a select statement allows you to set a title for the field for example

select fred as jim
from jack

would display the title "jim" in the field list.

I would put a debug.print strSQL at the end of the loop so you can see what it is coming up with as it is difficult for me to know what it will evaluate as without knowing the contents of the variables.

John
 
thanks John, one of my quotes was misplaced so the sql read
select fred & as jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top