I have a database of events for the next 12 months.
How do I query the top 5 events based on today's date for the next 6 months?
What is the syntax for the today's date and six months from now?
I've tried this:
$query = 'SELECT TOP 5 date
,startTime
,endTime
,title
,details
,room
FROM
WWW.dbo.Events
WHERE date BETWEEN (today) and (six months from today)
ORDER BY date DESC';
6 months from now: DATEADD(month, 6, GETDATE())