The following code worked fine in Mysql (Note: Already changed mysql to mssql). It queries a table for songs added in the last 30 days (today - 30).
$dayspast = 30;
$result = mssql_query("
SELECT date_added, artist, title, album
AND date_added > (SUBDATE(NOW(),INTERVAL '".$dayspast."' DAY))
ORDER BY date_added DESC, artist,title,album", $sqlconnect);
I am getting an error saying NOW is not a recognized function name.
Can someone help me code this correctly for a MS SQL DB?
It would be GREATLY appreciated.
MSSQL - Query Last 30 Days
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users