--- Jer <[EMAIL PROTECTED]> wrote: > I'm trying to generate a table that gives some > statistics. I've got a date time column that > registers hits. I need to calculate the number of > hits for 2006 using the 'date' column, which > is the date time column. > > How do I access only the year?
What format is the data in? Is it like "2006-07-04"? If so, you can use a query something along the order of SELECT * FROM hits WHERE date LIKE "2006-%" or something like that? If the data is stored as UNIX timestamps, then you can use mktime() functions to find out the timestamps for 11:59pm 12/31/2005 and 12:00am 1/1/2007 and query for everything between them. Michael Roush [EMAIL PROTECTED] "The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect." -- Tim Berners-Lee, W3C Director and inventor of the World Wide Web __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
