• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

ASP Stored Procedure DATE Default Value

Hello, I'm building an ASP stored procedure to do an insert & then return a recordset,... one of the lines inserts into a date column, what I would like to do is give it a default value of Today -1day if no value is submitted ---

The relevent lines on the SP currently looks like -

Dim CMDProductInsert__availabledate
CMDProductInsert__availabledate = "dat"
if(UploadFormRequest("availabledate") <> "") then CMDProductInsert__availabledate = Server.HTMLEncode(ProtectSQL(UploadFormRequest("availabledate")))

Open in new window


Where "dat" is where I want the default value to go...

Thanks
0
garethtnash
Asked:
garethtnash
  • 2
1 Solution
 
OnALearningCurveCommented:
Hi garethtnash,

Try:

CMDProductInsert__availabledate = DateAdd("d", -1, Now())

Hope this helps,

Mark.
0
 
garethtnashAuthor Commented:
Thank you
0
 
OnALearningCurveCommented:
Glad I could help
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now