paul Posted April 25, 2008 Share Posted April 25, 2008 I've got a query .. .see below it does some date stuff ... it gets the date from the server (timezone support) the server this runs on is in a different timezone to me ... who's the SQL wizard here? SELECT DISTINCT(ID_EVENT), ID_TOPIC,title,startDate,endDate,members.ID_MEMBER, memberName FROM calendar JOIN members USING(ID_MEMBER) WHERE (`startDate` >= CURDATE() AND `endDate` <= ADDDATE('2008-04-26', interval 7 day)) OR (`startDate` < CURDATE() AND `endDate` >= ADDDATE('2008-04-26', interval 7 day)) ORDER BY startDate ASC Link to comment Share on other sites More sharing options...
paul Posted April 25, 2008 Author Share Posted April 25, 2008 you lot a are too slow :) SELECT DISTINCT(ID_EVENT), ID_TOPIC,title,startDate,endDate,members.ID_MEMBER, memberName FROM calendar JOIN members USING(ID_MEMBER) WHERE (`startDate` >= CONVERT_TZ(CURDATE(),'UTC','NZ') AND `endDate` <= CONVERT_TZ(ADDDATE('2008-04-26', interval 7 day),'UTC','NZ')) OR (`startDate` < CONVERT_TZ(CURDATE(),'UTC','NZ') AND `endDate` >= CONVERT_TZ(ADDDATE('2008-04-26', interval 7 day),'UTC','NZ')) ORDER BY startDate ASC Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted April 26, 2008 Share Posted April 26, 2008 Glad we could help. Link to comment Share on other sites More sharing options...
SilverSurfer60 Posted April 26, 2008 Share Posted April 26, 2008 I was just about to give you the answer. Link to comment Share on other sites More sharing options...
tyme Posted April 26, 2008 Share Posted April 26, 2008 If I had seen this in the half hour between you first in second posts...i coulda helped. :D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now