terp_in_umcp
02-12-2007, 03:09 PM
Hi there...I am trying to add a variable to the month in the dateadd function but everytime i do it it just inserts a null into the db. What i am really trying to do is...for the first record, it should add 1 to the month. For the 2nd record it should add 2 to the month and so on it the eof is reached...
Here's the code...
x=1
do while pdcrecs.eof<>true
mysql="UPDATE pdc SET deposit=DATEADD(month,x,'"&First("deposit")&"') WHERE number='"& Request.Cookies("EFC")("Account")& "' and UID='"& pdcrecs("UID")&"'"
con.Execute(mysql)
x=x+1
pdcrecs.movenext
loop
-------------------------------------------------------------------------
The moment I change the x to 1 or some number, it works fine. I also tried putting x in quotes but that dint work...any clues???
Thanks!
Here's the code...
x=1
do while pdcrecs.eof<>true
mysql="UPDATE pdc SET deposit=DATEADD(month,x,'"&First("deposit")&"') WHERE number='"& Request.Cookies("EFC")("Account")& "' and UID='"& pdcrecs("UID")&"'"
con.Execute(mysql)
x=x+1
pdcrecs.movenext
loop
-------------------------------------------------------------------------
The moment I change the x to 1 or some number, it works fine. I also tried putting x in quotes but that dint work...any clues???
Thanks!