adding current_timestamp
Hi,
I am currently trying to add a timestamp+(variable) to my mssql database via a JSP. I can add the simple time stamp by doing the following:
...
PreparedStatement ps = connection.prepareStatement("INSERT INTO table1 VALUES (?,?,?, CURRENT_TIMESTAMP+5)");
...
...which adds 5 days to the current date. However if i wanted to replace '5' with a variable how do i go about doing this. i have tried for example:
...
String extraDays = 5;(just for example)
...
PreparedStatement ps = connection.prepareStatement("INSERT INTO table1 VALUES (?,?,?, CURRENT_TIMESTAMP+extraDays)");
...
also tried by replacing with:
CURRENT_TIMESTAMP+"extraDays"
CURRENT_TIMESTAMP+'extraDays'
but none of them seem to work.
Any help would be gladly appreciated.
Message was edited by:
haggard17

