Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Parameter in a Stored Proc

Status
Not open for further replies.

u104741

MIS
Aug 26, 2003
94
0
0
GB
I am having trouble getting a stored prcedure to run with vbscript, that has 2 parameters the first is a string for a table name and the second is For the current date.

Now the SP i know works ok as if I run the following in Query analyser it runs ok

EXEC sp_UpdateTable 'Properties', '2005-06-14'

But i cant seem to pass the variables when trying to get a vbscript to execute the SP. Basically i am having trouble passing the date value.

Any ideas anyone, beg, beg!!!!!
 
What does your VBScript code look like?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
A starting point:
strDate="'" & Year(Date) & "-" & Right("0" & Month(Date),2) & "-" & Right("0" & Day(Date),2) & "'"
MsgBox strDate

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Many thanks for this amazing what sleeping on an issue can do for you!!!

I had already tried to do as you suggest but.. just realised that I was passing the Day and month in the wrong order hence I was gettting and error cant pass varchar as date!

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top