MySQL Forums
Forum List  »  Newbie

select julian day from datetime field
Posted by: adam kennedy
Date: November 12, 2007 03:30PM

Hi,

I am trying to build a SELECT query that allows the user to pull a specific day from a table of data. Currently, I have a year, day, and time field, so the user can SELECT * from TABLE where year = 2006 AND day = 245. I'm dropping these three fields in exchange for one datetime field (with the format yyyy-mm-dd hh:mm). Now when I select day(datetime) = 245 no records are found because I suspect that the days are being counted as 1 - 28, 30, and 31. Is there a simple way around this like a julian day function that is included in the SELECT statement?

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
select julian day from datetime field
November 12, 2007 03:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.