TSQL - how do you pass in a date value manually?

When calling a stored proc manually, via a "right click" on a stored proc then choosing "Execute..."  how do I pass in a date value as one of the params?

date value tsql
Tom KnowltonWeb developerAsked:
Who is Participating?

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

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.

Jim HornMicrosoft SQL Server Data DudeCommented:
Try typing the value in the cell that is the intersect between @DateBegin and Value.

An easier way would be to execute it in SSMS..
exec unsp_the_sp_name 1, '2015-07-01'

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
ste5anSenior DeveloperCommented:
As date literal. E.g.'20150713'. There are more recognized formats, but this one is one of the save ones. Cause it's the ISO 8601 format, which is not affected by any locales or regional settings.
Tom KnowltonWeb developerAuthor Commented:
Typing in 2015-07-01 worked fine.

What did you mean by this:

Try typing the value in the cell that is the intersect between @DateBegin and Value.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Kelvin SparksCommented:
If using the popup from the Execute just type the date into the cell i.e 1-jun-2015 will work. No need for Quotes for anything else.

ste5anSenior DeveloperCommented:
@Jim: Date literals with dashes depend on the DATEFROMAT setting and the date type. E.g. this may be ambiguous:

DECLARE @Date DATETIME = '2015-07-01';
SELECT FORMAT(@Date, 'yyyy-MM-dd');

SET @Date = '2015-07-01';
SELECT FORMAT(@Date, 'yyyy-MM-dd');

Open in new window

Jim HornMicrosoft SQL Server Data DudeCommented:
The asker's country of origin is United States, so I made a yyyy-mm-dd assumption, and figured we can talk about date formats if it became an issue.

Thanks for the grade.  Good luck with your project.  -Jim
Tom KnowltonWeb developerAuthor Commented:
Thanks for the grade.  Good luck with your project.  -Jim


And yeah, I am from the USA (Utah)  : )
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
Microsoft SQL Server

From novice to tech pro — start learning today.