completeamateur Posted June 19, 2008 Share Posted June 19, 2008 Hello, I'm trying to query a database to obtain the correct results for a particular season. I'm trying to do this... (YEAR(datetime) = 2008 AND MONTH(datetime) < 07) OR (YEAR(datetime) = 2007 AND MONTH(datetime) >= 07) but it returns no rows. Confused as using one or the other works so I don't see why I can't use both. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/110920-complex-datetime-query/ Share on other sites More sharing options...
completeamateur Posted June 19, 2008 Author Share Posted June 19, 2008 Ok scrap that, it seems to be working now. Bizarre. Instead, Does anybody know an easy way of converting a single digit to a double, i.e. 1 --> 01 Thanks Link to comment https://forums.phpfreaks.com/topic/110920-complex-datetime-query/#findComment-569041 Share on other sites More sharing options...
fenway Posted June 19, 2008 Share Posted June 19, 2008 There's a PERIOD function. Link to comment https://forums.phpfreaks.com/topic/110920-complex-datetime-query/#findComment-569339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.