I have to insert a date in a DB and I want to set the end date 2 weeks after that date.
How can I make it?
in my select, I guess there is needed something like:
insert into table values (current_Date, current_Date+2weeks) where....
But I don't know how to do it.
for mysql
INSERT INTO tbl(fromdate,todate) values (now(), DATE_ADD(now(),INTERVAL 2 WEEK))
for sql server
INSERT INTO tbl(fromdate,todate) values( current_timestamp, DATEADD(week,2,current_timestamp))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With