Jacques Posted July 26, 2010 Share Posted July 26, 2010 Hey Guys, I need some help, i was tasked to create a new column in the a DB i manage. This is to calculate warranty statuses: My Query is as follows: INSERT INTO #TABLENAME# (#NEW COLUMN ADDED#) VALUES (DATE_ADD(#DateColumn#,INTERVAL 42 MONTH)) This does not work. Can anyone please assist with this? KR Jacques Quote Link to comment https://forums.phpfreaks.com/topic/208909-simple-insert-into-statement-gone-wrong/ Share on other sites More sharing options...
Mchl Posted July 26, 2010 Share Posted July 26, 2010 Do you want to INSERT a new row or UPDATE existing rows? Quote Link to comment https://forums.phpfreaks.com/topic/208909-simple-insert-into-statement-gone-wrong/#findComment-1091220 Share on other sites More sharing options...
Jacques Posted July 26, 2010 Author Share Posted July 26, 2010 Insert New Rows. I need to calculate from Existing Date column. For example DATE_ADD(ShipDate, INTERVAL 42 MONTH) AS Warrdate Quote Link to comment https://forums.phpfreaks.com/topic/208909-simple-insert-into-statement-gone-wrong/#findComment-1091222 Share on other sites More sharing options...
Mchl Posted July 26, 2010 Share Posted July 26, 2010 That sound's like you're updating existing rows, so you should use UPDATE query UPDATE #TABLENAME# SET #NEW COLUMN ADDED# = DATE_ADD(#DateColumn#,INTERVAL 42 MONTH) Quote Link to comment https://forums.phpfreaks.com/topic/208909-simple-insert-into-statement-gone-wrong/#findComment-1091227 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.