Skip navigation links

MySQL Forums :: Newbie :: select julian day from datetime field


Advanced Search

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 adam kennedy 11/12/2007 03:30PM
Re: select julian day from datetime field Peter Brawley 11/12/2007 03:33PM
Re: select julian day from datetime field adam kennedy 11/12/2007 03:34PM
Re: select julian day from datetime field Anthony Willard 11/12/2007 04:05PM


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.