I am trying to combined to queries. This is my first
SELECT dbo_Campaign.Campaign_Name, dbo_Drop_Downs.Description, dbo_History.History_Guid, dbo_Drop_Downs.Order_Value
FROM (dbo_Campaign INNER JOIN dbo_History ON dbo_Campaign.Campaign_Guid = dbo_History.Campaign_Guid) INNER JOIN dbo_Drop_Downs ON dbo_History.STATUS = dbo_Drop_Downs.DropDown_Guid
WHERE (((dbo_Campaign.Campaign_Name)=[forms]![main form]![camp code]));
At present the above one is saved as 'z_CampaignStats_Breakdown1', and then used within this one.
SELECT z_CampaignStats_Breakdown1.Description AS [Lead Code], Count(z_CampaignStats_Breakdown1.History_Guid) AS Count
FROM z_CampaignStats_Breakdown1
GROUP BY z_CampaignStats_Breakdown1.Description, z_CampaignStats_Breakdown1.Order_Value
ORDER BY z_CampaignStats_Breakdown1.Order_Value;
What I would like to happen, is to get the SQL statement looking like this
SELECT z_CampaignStats_Breakdown1.Description AS [Lead Code], Count(z_CampaignStats_Breakdown1.History_Guid) AS Count
FROM (SELECT dbo_Campaign.Campaign_Name, dbo_Drop_Downs.Description, dbo_History.History_Guid, dbo_Drop_Downs.Order_Value
FROM (dbo_Campaign INNER JOIN dbo_History ON dbo_Campaign.Campaign_Guid = dbo_History.Campaign_Guid) INNER JOIN dbo_Drop_Downs ON dbo_History.STATUS = dbo_Drop_Downs.DropDown_Guid
WHERE (((dbo_Campaign.Campaign_Name)=[forms]![main form]![camp code]))) AS z_CampaignStats_Breakdown1
GROUP BY z_CampaignStats_Breakdown1.Description, z_CampaignStats_Breakdown1.Order_Value
ORDER BY z_CampaignStats_Breakdown1.Order_Value;
But Access gives me errors...
Am i doing something wrong, any help would be appreciated
Many thanks for looking.
SELECT dbo_Campaign.Campaign_Name, dbo_Drop_Downs.Description, dbo_History.History_Guid, dbo_Drop_Downs.Order_Value
FROM (dbo_Campaign INNER JOIN dbo_History ON dbo_Campaign.Campaign_Guid = dbo_History.Campaign_Guid) INNER JOIN dbo_Drop_Downs ON dbo_History.STATUS = dbo_Drop_Downs.DropDown_Guid
WHERE (((dbo_Campaign.Campaign_Name)=[forms]![main form]![camp code]));
At present the above one is saved as 'z_CampaignStats_Breakdown1', and then used within this one.
SELECT z_CampaignStats_Breakdown1.Description AS [Lead Code], Count(z_CampaignStats_Breakdown1.History_Guid) AS Count
FROM z_CampaignStats_Breakdown1
GROUP BY z_CampaignStats_Breakdown1.Description, z_CampaignStats_Breakdown1.Order_Value
ORDER BY z_CampaignStats_Breakdown1.Order_Value;
What I would like to happen, is to get the SQL statement looking like this
SELECT z_CampaignStats_Breakdown1.Description AS [Lead Code], Count(z_CampaignStats_Breakdown1.History_Guid) AS Count
FROM (SELECT dbo_Campaign.Campaign_Name, dbo_Drop_Downs.Description, dbo_History.History_Guid, dbo_Drop_Downs.Order_Value
FROM (dbo_Campaign INNER JOIN dbo_History ON dbo_Campaign.Campaign_Guid = dbo_History.Campaign_Guid) INNER JOIN dbo_Drop_Downs ON dbo_History.STATUS = dbo_Drop_Downs.DropDown_Guid
WHERE (((dbo_Campaign.Campaign_Name)=[forms]![main form]![camp code]))) AS z_CampaignStats_Breakdown1
GROUP BY z_CampaignStats_Breakdown1.Description, z_CampaignStats_Breakdown1.Order_Value
ORDER BY z_CampaignStats_Breakdown1.Order_Value;
But Access gives me errors...
Am i doing something wrong, any help would be appreciated
Many thanks for looking.