gerkintrigg Posted April 2, 2007 Share Posted April 2, 2007 I've tried using the following code to add a day to the current date value: SELECT ( start_date +1 ), start_date FROM `booking` WHERE 1 LIMIT 0 , 30 but it's just returning the numbers with a 1 added to it... so "dates" like 20070332 Can anyone suggest how to change this to a real date? Link to comment https://forums.phpfreaks.com/topic/45326-adding-a-day-to-an-sql-date-field/ Share on other sites More sharing options...
Wildbug Posted April 2, 2007 Share Posted April 2, 2007 Try the DATE_ADD() function. SELECT DATE_ADD(start_date, INTERVAL 1 DAY), start_date FROM booking WHERE 1 LIMIT 0,30; ...or even: SELECT start_date + INTERVAL 1 DAY,start_date FROM booking WHERE 1 LIMIT 0,30; Link to comment https://forums.phpfreaks.com/topic/45326-adding-a-day-to-an-sql-date-field/#findComment-220089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.