MichelleButler
IS-IT--Management
Help!!! I have users inputting dates from a calendar that insert the dates they required into the form, but I would also like to be able to populate the next field that add 84 days onto it, from the first field. Here is an example of the code:
<%
Dim Conn ' Open Database Connection
Dim RS ' Open Record Set
Dim SQL ' SQL statement
Dim DSN ' DSN Less Connection
Dim StrParam '
StrParam = Request.QueryString("id")
DSN = "DBQ=" & Server.Mappath("../../Database/Master Tables.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set RS = Server.CreateObject("ADODB.Recordset")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DSN
SQL = " SELECT [12WeeklyReview].Id, [12WeeklyReview].[ServiceNo], [12WeeklyReview].Surname, [12WeeklyReview].[FirstName], [12WeeklyReview].Station, [12WeeklyReview].DateReview, [12WeeklyReview].DateReviewCarriedOut, [12WeeklyReview].DateNextReviewDue FROM 12WeeklyReview WHERE id="&StrParam
RS.Open SQL,Conn,3,1
if Request.Form("Update") = "Update" Then
if Request.Form("DateReviewCarriedOut") = "" Then
Response.Redirect("erroreditstudent.asp?Error=Date Review can't be blank")
End if
DateReviewCarriedOut = Request.Form("DateReviewCarriedOut")
SQLUpdate = "UPDATE 12WeeklyReview SET "
SQLUpdate = SQLUpdate & "DateReviewCarriedOut='"&DateReviewCarriedOut
SQLUpdate = SQLUpdate & "'WHERE ID=" & StrParam
Conn.execute SQLUpdate
response.Redirect("done.asp?Msg=Record has been updated")
Else
%>
The field DateReviewCarriedout is inserted with the date, but I would like to be able to add 84 days onto next the date that would be the NextReviewdate due. Please help!!!
Michelle
<%
Dim Conn ' Open Database Connection
Dim RS ' Open Record Set
Dim SQL ' SQL statement
Dim DSN ' DSN Less Connection
Dim StrParam '
StrParam = Request.QueryString("id")
DSN = "DBQ=" & Server.Mappath("../../Database/Master Tables.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set RS = Server.CreateObject("ADODB.Recordset")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DSN
SQL = " SELECT [12WeeklyReview].Id, [12WeeklyReview].[ServiceNo], [12WeeklyReview].Surname, [12WeeklyReview].[FirstName], [12WeeklyReview].Station, [12WeeklyReview].DateReview, [12WeeklyReview].DateReviewCarriedOut, [12WeeklyReview].DateNextReviewDue FROM 12WeeklyReview WHERE id="&StrParam
RS.Open SQL,Conn,3,1
if Request.Form("Update") = "Update" Then
if Request.Form("DateReviewCarriedOut") = "" Then
Response.Redirect("erroreditstudent.asp?Error=Date Review can't be blank")
End if
DateReviewCarriedOut = Request.Form("DateReviewCarriedOut")
SQLUpdate = "UPDATE 12WeeklyReview SET "
SQLUpdate = SQLUpdate & "DateReviewCarriedOut='"&DateReviewCarriedOut
SQLUpdate = SQLUpdate & "'WHERE ID=" & StrParam
Conn.execute SQLUpdate
response.Redirect("done.asp?Msg=Record has been updated")
Else
%>
The field DateReviewCarriedout is inserted with the date, but I would like to be able to add 84 days onto next the date that would be the NextReviewdate due. Please help!!!
Michelle