scriptygoddess

27 Jun, 2004

Getting Dates in mySQL with MIN() and MAX()

Posted by: Jennifer In: mySQL

I'm working on a plugin that required getting the earliest date in the database, and also getting the oldest date in the database. I was hoping that there was a built-in function that did this – and there is. :)

I found this helpful article on various mySQL techniques. And this is the one I was going to use:

MIN() will return the earliest date, while MAX() returns the latest date.

So the mySQL statement will look something like this:

SELECT MIN(DateFieldName) FROM TableName

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

1 Response to "Getting Dates in mySQL with MIN() and MAX()"

1 | JM

June 28th, 2004 at 9:31 am

Avatar

That was weird. I was just following top100 blogroll links to find new stuff to read, and I find a link to something I wrote. Did you need help with something? Just holler.

Featured Sponsors

About


Advertisements