Date operation ASP and SQL server 2005

Example for Date operation ASP and SQL server 2005

This examples shows the substraction, relational operations with dates.

test = date()

testmonth = month(test) - 6

testd = month(testmonth) & "/" & day(test) & "/" & year(test)

testyear = year(testd)

If month(testd) > month(test) then
testyear = year(testd) - 1
End if

testdate = month(testd) & "/" & day(testd) & "/" & testyear

response.write test & "<br>"
response.write testd & "<br>"
response.write testdate  & "<br>"
By Perry    Popularity  (1000 Views)