Stored procedure to update date

I created a simple stored procedure to update the date in which an email goes out. I am just not sure the syntax to have the date be 'today's date / time'

This is my code at the moment:

<%

Dim sp_updatepassdate__UserLoginId
sp_updatepassdate__UserLoginId = "0"
if(Request("UserLoginId") <> "") then sp_updatepassdate__UserLoginId = Request("UserLoginId")

Dim sp_updatepassdate__Passwordemailon
sp_updatepassdate__Passwordemailon = "01/01/2050"
if(today() <> "") then sp_updatepassdate__Passwordemailon = today()

%>

<%

set sp_updatepassdate = Server.CreateObject("ADODB.Command")
sp_updatepassdate.ActiveConnection = MM_bluedot_STRING
sp_updatepassdate.CommandText = "dbo.Updatepasswdemailedate"
sp_updatepassdate.CommandType = 4
sp_updatepassdate.CommandTimeout = 0
sp_updatepassdate.Prepared = true
sp_updatepassdate.Parameters.Append sp_updatepassdate.CreateParameter("@RETURN_VALUE", 3, 4)
sp_updatepassdate.Parameters.Append sp_updatepassdate.CreateParameter("@UserLoginId", 3, 1,4,sp_updatepassdate__UserLoginId)
sp_updatepassdate.Parameters.Append sp_updatepassdate.CreateParameter("@Passwordemailon", 135, 1,4,sp_updatepassdate__Passwordemailon)
sp_updatepassdate.Execute()

%>

Open in new window


Line 9 shows where I enter the value:

if(today() <> "") then sp_updatepassdate__Passwordemailon = today()

I get this error:

Microsoft VBScript runtime  error '800a000d'

Type mismatch: 'today'

/bluedot/Intranet/Contacts/webaccess_emailing.asp, line 18
LVL 1
AleksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun KlineLead Software EngineerCommented:
ASP uses "Date" for the current date.
ASP uses "Now" for the current date & time.
ASP uses "Time" for the current time.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robin SandlinCommented:
The mismatch is from comparing a string ""  to a datetype today().
AleksAuthor Commented:
now()     worked  :)
AleksAuthor Commented:
Thanks !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.