Topic: Help with a simple problem !
I ask the help in the decision, apparently, the simple task.
There are two tables:
Sales (sale Date, the Total)
Course (course Date, Course)
It is necessary them so that to each date of sale there would correspond the course.
Problem in that the Course is not always installed in sale date (can head which has been installed yesterday or the day before yesterday).
My request works not correctly.
select cast ([Sale]. [Sale Date] as date) as ' sale Date '; [Sale]. [Total]; [Course]. [Course] from [Sale] left join [Course] on cast ([Sale]. [Sale Date] as date) = (SELECT max (cast ([Course]. [Course Date] as date)) as MaxDate FROM [Course] WHERE cast ([Sale]. [Sale Date] as date)> = cast ([Course]. [Course Date] as date) )