I’m not familiar with SQL Server syntax, but I imagine it would go something like this:
$year = 2010;
$query = mssql_query("SELECT * FROM dbo.events
WHERE date BETWEEN $year AND $year-1");
I’m just not sure how to format $year in this case.
You’re close. Assuming the
datecolumn is a datetime datatype: