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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS clause

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
 
jommyjet,

CopyOfOriginal:
strSQL = strSQL & ",[summaryFTEconfirmed].[countof" & strTEMP & "] As confirmed" & strTEMP & ",[summaryFTEnamed].[countof" & strTEMP & "]" & "AS named " & strTEMP

I'm assuming the summaryFTEconfirmed is a query which includes the field named as 'countof'. The very easy way of finding out why it doesn't work is to set a breakpoint immediately past where the strSQL string is constructed and enter the following in the immediate window. When I put quotes around strTemp, because I don't know the values of your variables, it produced the following string, which is all you provided. If you check the 'AS' has no space before it and after the bracket.

?strSQL
,[summaryFTEconfirmed].[countofstrTemp] As confirmedstrTemp,[summaryFTEnamed].[countofstrTemp]AS named strTemp





---------------------
scking@arinc.com
---------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top