Pass Through Query Problems

  • Thread starter Thread starter Mark
  • Start date Start date
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
 
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
 
Back
Top