leachus2002 Posted January 18, 2011 Share Posted January 18, 2011 Hi All, When inserting data into a DB I get a current timestamp using GETDATE() - however, I would like to insert a date that is say 3 working day's from the time the record was inserted. Is this possible? If so, how would I go about it? Thanks Matt Quote Link to comment https://forums.phpfreaks.com/topic/224811-inserting-getdate-3-into-a-db/ Share on other sites More sharing options...
bh Posted January 18, 2011 Share Posted January 18, 2011 DATE_ADD('2010-05-10', INTERVAL 3 DAY); -> 2010-05-13 in your situation: DATE_ADD(GETDATE(), INTERVAL 3 DAY); Quote Link to comment https://forums.phpfreaks.com/topic/224811-inserting-getdate-3-into-a-db/#findComment-1161221 Share on other sites More sharing options...
leachus2002 Posted January 18, 2011 Author Share Posted January 18, 2011 Thanks for that Bh, How would I stop it inserting weekend dates? Thanks Matt Quote Link to comment https://forums.phpfreaks.com/topic/224811-inserting-getdate-3-into-a-db/#findComment-1161223 Share on other sites More sharing options...
bh Posted January 18, 2011 Share Posted January 18, 2011 mysql date functions manual - dayofweek(date) Quote Link to comment https://forums.phpfreaks.com/topic/224811-inserting-getdate-3-into-a-db/#findComment-1161225 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.