Click to See Complete Forum and Search --> : allow add records within a specific month


joelo
09-19-2003, 03:11 PM
Please could anybody help with this?...... I am trying to setup my form page to allow submission of records into my database if the datefield.value is within a particular month
(server month) i.e March and if it is passed the month, not to allow submission.

rdoekes
09-20-2003, 10:37 AM
If DateDiff("m", Request.Form("datefield"), Now()) >= 0 Then
oCnn.Execute strSQL
End if

Where oCnn is the connection object, and strSQL the insert query string. Ensure only valid dates are allowed in the datefield, otherwise the DateDiff will return in error.

Hope this helps,

-Rogier Doekes