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

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

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements