paul Posted April 25, 2008 Report 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 Quote Link to comment Share on other sites More sharing options...
paul Posted April 25, 2008 Author Report 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 Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted April 26, 2008 Report Share Posted April 26, 2008 Glad we could help. Quote Link to comment Share on other sites More sharing options...
SilverSurfer60 Posted April 26, 2008 Report Share Posted April 26, 2008 I was just about to give you the answer. Quote Link to comment Share on other sites More sharing options...
tyme Posted April 26, 2008 Report Share Posted April 26, 2008 If I had seen this in the half hour between you first in second posts...i coulda helped. :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.