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 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); 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 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) 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
Archived
This topic is now archived and is closed to further replies.