Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL Using Date Column in Where without selecting it

Hi

In the following SQL statement I want to take [Performance].[Date] out of the SELECT line and leave it in the WHERE line
but this causes an error

SELECT  [Performance].[Date],[Shafts].[Shaft],Sum([Performance].[Drilled Total]) AS Metres,SUM([Shafts].[Target]) As Target 
FROM [Performance] Inner Join [Shafts] On [Performance].[Shaft] = [Shafts].[Shaft] 
WHERE [Performance].[Date] >= [Shafts].[From] And [Performance].[Date] <= '05 Nov 2015' 
GROUP BY [Shafts].[Shaft],[Performance].[Date] ORDER BY [Shafts].[Shaft]

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

I've requested that this question be deleted for the following reason:

found answer
Thanks. I hadn't realized that a solution had been given