Hi folks,

I'm having trouble trying to get an SQL Query working with a join. I have two
tables, one called Vacancy and the other called MonitoringData.

This is the layout of the tables:

Vacancy
VacancyRef - (Primary Key, data type is varchar)
VacancyTitle
Department
VacancyDetails

MonitoringData
MDataID - (Primary Key, data type is auto increment)
VacancyRef
Gender
MaritalStatus
AgeBand
... I won't add the rest, since you can see them in the query, but hopefully
you get the picture.

Anyway, when I try and run the query I get the following error:
Line 1: Incorrect syntax near '.'.

And this is the Query I'm using:

SELECT DISTINCT md.MDataID, md.VacancyRef, md.Gender, md.MaritalStatus,
md.AgeBand, md.EthnicGroup, md.EthnicOrigin, md.OtherEthnicDesc, md.Disability,
md.DisabilityDetails, md.AdvertSource, v.VacancyRef v.VacancyTitle,
v.VacancyDept, v.VacancyDetails
FROM dbo.MonitoringData md RIGHT OUTER JOIN
dbo.Vacancy v ON md.VacancyRef = v.VacancyRef

Can anyone help with this?

Thanks