Hey there.. in my never ending quest to get this DB up n running I have come across another hurdle to overcome...
I am trying to generate a report from an Access 2K front end, with a pass through query..
the problem that I have is that I don't seem able to use the COUNT DISTINCT formulae in Access.. I have checked the code below with Query analyser, and do not recieve an error, however when I put the same code (with a little tweaking to add more ' 's) I get the following error:
Syntax Error (missing operator) in query expression 'COUNT (DISTINCT dbo.tblSWInstallBase.System)'
Can anyone help with this?? here is my SQL code...
I think that this is because Access doesn't support Count Distinct... I have tried to run the query through VBA also, but again without success... :¬(
Thanks in adv for any help
I am trying to generate a report from an Access 2K front end, with a pass through query..
the problem that I have is that I don't seem able to use the COUNT DISTINCT formulae in Access.. I have checked the code below with Query analyser, and do not recieve an error, however when I put the same code (with a little tweaking to add more ' 's) I get the following error:
Syntax Error (missing operator) in query expression 'COUNT (DISTINCT dbo.tblSWInstallBase.System)'
Can anyone help with this?? here is my SQL code...
Code:
SELECT dbo.tblSWInstallBase.Manufacturer, dbo.tblSWInstallBase.Product, dbo.tblSWInstallBase.Version, dbo.tblSWInstallBase.Release,
COUNT (DISTINCT dbo.tblSWInstallBase.System) AS Installs, dbo.tblSWInstallBase.CostCenter AS CostCentre,
dbo.tblMLCostCenters.StrategicBU AS BusinessUnit
FROM dbo.tblMLCostCenters INNER JOIN dbo.tblSWInstallBase ON dbo.tblMLCostCenters.CostCenter = dbo.tblSWInstallBase.CostCenter INNER JOIN
dbo.tblSWLink ON dbo.tblSWInstallBase.Manufacturer = dbo.tblSWLink.Manufacturer AND dbo.tblSWInstallBase.Product = dbo.tblSWLink.Product AND
dbo.tblSWInstallBase.Version = dbo.tblSWLink.Version AND dbo.tblSWInstallBase.Release = dbo.tblSWLink.Release
GROUP BY dbo.tblSWInstallBase.Manufacturer, dbo.tblSWInstallBase.Product, dbo.tblSWInstallBase.Version, dbo.tblSWInstallBase.Release, dbo.tblMLCostCenters.StrategicBU, dbo.tblSWInstallBase.CostCenter
HAVING ((dbo.tblSWInstallBase.Manufacturer LIKE ("'" & '[forms]![frmSWSelect]![cboSWMan]' & "'")) AND (dbo.tblSWInstallBase.Product LIKE ("'" & '[forms]![frmSWSelect]![cboSWProd]' & "'")) AND (dbo.tblSWInstallBase.Version LIKE ("'" & '[forms]![frmSWSelect]![cboSWVer]' & "'")))
I think that this is because Access doesn't support Count Distinct... I have tried to run the query through VBA also, but again without success... :¬(
Thanks in adv for any help