This topic is locked
[SOLVED]

 Adding Days to Field

10/16/2011 5:44:13 PM
ASPRunnerPro General questions
author

Using ASPRunnerPro 6.3 build 7474.

SQL Server 2008 R2 Express and Access DBs
I have a need to add 20 days to a date field called DateDue using the date in a field named DateAssigned. DateAssigned is completed prior to the DateDue field.

  1. First where do I place the code? In the DateDue properties default value? In the Events after Add for the Add Page?
  2. What would be the syntax to add the 20 days to the DateDue field?
    What would be a proper ASP expression and place to use to add 20 calender days to the DateAssigned field and place it into the DateDue field?
    I am not finding how to do this and any help would be appreciated.

    Thanks

    Joe

1312 10/19/2011



Using ASPRunnerPro 6.3 build 7474.

SQL Server 2008 R2 Express and Access DBs
I have a need to add 20 days to a date field called DateDue using the date in a field named DateAssigned. DateAssigned is completed prior to the DateDue field.

  1. First where do I place the code? In the DateDue properties default value? In the Events after Add for the Add Page?
  2. What would be the syntax to add the 20 days to the DateDue field?
    What would be a proper ASP expression and place to use to add 20 calender days to the DateAssigned field and place it into the DateDue field?
    I am not finding how to do this and any help would be appreciated.

    Thanks

    Joe


In researching the problem, I found the answer. In the field default value you can put the following code. Now this is assuming that the recorded is entered and the assigned date is the same.
DateAdd("d",20,Now())
Works like a champ.

Joe