I am looking for help in the following scenario:
I have a SQL Server database with a table that stores historical data. For example, you can use the following as a set of samples.
CAR, SERVICE DATE, FINDINGS
1234, 21/01/2001, Fuel Filter
1234, 23/09/2009, Oil Change
1234, 30/09/2015, Tyres
3456, 30/09/2015, Clutch
I would like from the following example to return a result that shows the service of any car that was entered on a dating date, for example. 09/30/2015, but only in the case of an oil change in the past.
The request will only return:
1234, 30/09/2015, Tyres
since this is the only car on this date to be services that previously had an oil change.
Any help would be greatly appreciated.
source
share