?
Solved

ASP Stored Procedure DATE Default Value

Posted on 2011-09-07
3
Medium Priority
?
236 Views
Last Modified: 2012-05-12
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
Comment
Question by:garethtnash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
OnALearningCurve earned 2000 total points
ID: 36494312
Hi garethtnash,

Try:

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

Hope this helps,

Mark.
0
 

Author Closing Comment

by:garethtnash
ID: 36494340
Thank you
0
 
LVL 10

Expert Comment

by:OnALearningCurve
ID: 36494346
Glad I could help
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question