Solved

ASP Stored Procedure DATE Default Value

Posted on 2011-09-07
3
230 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
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
OnALearningCurve earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dynamics crm 2011 8 46
Group by and order by clause 28 36
Report Builder 9 31
Sending Attachment via CDO 3 22
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now