hello, my question is this, i have a piece of sql that works under "cars" but not "tractors" i've simley cut and pasted. i've checked and everything seems correct. the error i get is:
syntax error in join expression.
it errors out to a comma in the first line of the second paragraph, right after "TopUnit" here is my code:
SELECT [TRACTOR MAINTENANCE].[UNIT #], [TRACTOR MAINTENANCE].[DATE OF MAINTENANCE], [TRACTOR MAINTENANCE].MILAGE, [TRACTOR SPEC].MAKE, [TRACTOR SPEC].MODEL, [TRACTOR SPEC].[SERIAL #]
FROM [TRACTOR SPEC] INNER JOIN ([select [UNIT #] as TopUnit, Max([DATE OF MAINTENANCE]) as TopDate from [TRACTOR MAINTENANCE] group by [UNIT #]]. AS Tops INNER JOIN [TRACTOR MAINTENANCE] ON (Tops.TopUnit = [TRACTOR MAINTENANCE].[UNIT #]) AND (Tops.TopDate = [TRACTOR MAINTENANCE].[DATE OF MAINTENANCE])) ON [TRACTOR SPEC].[UNIT NUMBER] = [TRACTOR MAINTENANCE].[UNIT #];
why does it do this? any help would be great, thanks.
syntax error in join expression.
it errors out to a comma in the first line of the second paragraph, right after "TopUnit" here is my code:
SELECT [TRACTOR MAINTENANCE].[UNIT #], [TRACTOR MAINTENANCE].[DATE OF MAINTENANCE], [TRACTOR MAINTENANCE].MILAGE, [TRACTOR SPEC].MAKE, [TRACTOR SPEC].MODEL, [TRACTOR SPEC].[SERIAL #]
FROM [TRACTOR SPEC] INNER JOIN ([select [UNIT #] as TopUnit, Max([DATE OF MAINTENANCE]) as TopDate from [TRACTOR MAINTENANCE] group by [UNIT #]]. AS Tops INNER JOIN [TRACTOR MAINTENANCE] ON (Tops.TopUnit = [TRACTOR MAINTENANCE].[UNIT #]) AND (Tops.TopDate = [TRACTOR MAINTENANCE].[DATE OF MAINTENANCE])) ON [TRACTOR SPEC].[UNIT NUMBER] = [TRACTOR MAINTENANCE].[UNIT #];
why does it do this? any help would be great, thanks.