This content has been marked as final. Show 4 replies
It largely depends on the database and the date functions available to it. Of course, you could always use cf to generate a list of the last 27 Fridays and use that list in your query.
In MS SQL you can use:
WHERE DatePart(dw, myDateField) = 1
1 = Sunday
7 = Saturday
the database is mysql. that mssql line does not work with it and i can not find a datepart function on the mysql website.
anybody else here to help?
A quick google search turned up the mySQL date_format () function:
WHERE date_format(myDateField, '%W') = 'Friday'
I'm not that familiar with mySQL databases myself, so you might have to play around with the syntax above, but it seems like it should fill your requirements.