Solved

ASP Stored Procedure DATE Default Value

Posted on 2011-09-07
3
235 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

718 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