I have the following query
SELECT distinct DATEADD(hour, DATEDIFF(hour, 0, [Date Time]), 0) as Date
FROM [Vente A]
union
SELECT distinct DATEADD(hour, DATEDIFF(hour, 0, [Date Time]), 0)
FROM [Vente B]
UNION
SELECT distinct DATEADD(hour, DATEDIFF(hour, 0, [Date Time]), 0)
FROM [Budget B]
UNION
SELECT distinct DATEADD(hour, DATEDIFF(hour, 0, [Date Time]), 0)
FROM [Budget A]
I need to select date from Vente A and Vente B then select select from budget A and budget B where date is less than the max date from Vente A and Vente B
how can i do it ?