I need a little help with a date query
In our article table (currently MySQL), each article has a field 'publication_date.' I'm now programming to archives function for the site, and I would like to write the SQL statement such that it would run on MySQL, PGSQL, and MS SQL 2000 (basicially crossplatform).
The trouble is, it seems that each database has different ways of handling date/time functions.
Can anyone offer me any assistance? Here's what I have so far.
SELECT MIN(publication_date)
FROM story_table
WHERE YEAR(publication_date)='2002'
GROUP BY MONTH(publication_date) ORDER BY publication_date DESC