By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,645 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,645 IT Pros & Developers. It's quick & easy.

Adding a value to a timestamp

P: n/a
How do i display a date as a new column 7 days after the initial timestamp

eg
current timestamp = 20050310000000

if i add 7 days to this won't it result in 20050317000000
eg SELECT *, DATE_FORMAT('%d/%m/%Y' , (dateAuthorised+7)) as expiryDate

I know this is the wrong approach as the timestamp 20050330000000 would
cause an error

Any help would be grateful

Craig
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 18/04/2005, Craig Keightley wrote:
How do i display a date as a new column 7 days after the initial
timestamp


SELECT
DATE_FORMAT(ADDDATE(20050418000000, INTERVAL 7 DAY), "%d/%m/%Y") AS
ExpiryDate;

See http://dev.mysql.com/doc/mysql/en/da...functions.html

--
felix
Jul 23 '05 #2

P: n/a
thats great thanks, sorry - forgot to look at the manual

craig
"Felix Geerinckx" <fe*************@gmail.com> wrote in message
news:xn***************@news.easynews.com...
On 18/04/2005, Craig Keightley wrote:
How do i display a date as a new column 7 days after the initial
timestamp


SELECT
DATE_FORMAT(ADDDATE(20050418000000, INTERVAL 7 DAY), "%d/%m/%Y") AS
ExpiryDate;

See http://dev.mysql.com/doc/mysql/en/da...functions.html

--
felix

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.