Pass Through Query Problems

M

Mark

I'm writing the following query as a pass through to an
SQL server, but I'm running into problems.

UPDATE [SELECT SubmissionID, SubmissionType, Min
(SubmissionDate) AS SubDate, ClientId
FROM tPBA_Submissions
GROUP BY SubmissionID, SubmissionType, ClientId]
AS Fix INNER JOIN tPBA_Submissions AS Subs
ON (Fix.SubDate = Subs.SubmissionDate)
AND (Fix.ClientId = Subs.ClientId)
AND (Fix.SubmissionID = Subs.SubmissionID)
AND (Fix.SubmissionType = Subs.SubmissionType)
SET Subs.UniqueIndicator = "Y"

The error is the identifier that starts with SELECT... is
too long the maximum length is 128 and Incorrect syntax
near the keyword AS.

Is there any way to save the select statement as a
variable/parameter? What would be the syntax for that?

Thanks in advance.

Mark
 
J

John Spencer (MVP)

Also, if this is truly a passthrough query, SQL doesn't use Quote Marks it uses
apostrophes to delimit strings.

SET UniqueIndicator = 'Y'

Douglas J. Steele said:
Try replacing the square brackets with the usual parentheses.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)

Mark said:
I'm writing the following query as a pass through to an
SQL server, but I'm running into problems.

UPDATE [SELECT SubmissionID, SubmissionType, Min
(SubmissionDate) AS SubDate, ClientId
FROM tPBA_Submissions
GROUP BY SubmissionID, SubmissionType, ClientId]
AS Fix INNER JOIN tPBA_Submissions AS Subs
ON (Fix.SubDate = Subs.SubmissionDate)
AND (Fix.ClientId = Subs.ClientId)
AND (Fix.SubmissionID = Subs.SubmissionID)
AND (Fix.SubmissionType = Subs.SubmissionType)
SET Subs.UniqueIndicator = "Y"

The error is the identifier that starts with SELECT... is
too long the maximum length is 128 and Incorrect syntax
near the keyword AS.

Is there any way to save the select statement as a
variable/parameter? What would be the syntax for that?

Thanks in advance.

Mark
 

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

Top