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!

Select a DATE Parameter in CR and use it as a DATETIME data type in SP

Status
Not open for further replies.

pajr777

Technical User
Feb 18, 2003
11
0
0
GB
Hi,

I have a stored procedure which requires datetime parameter. When I create a CR on the SP, CR automatically creates parameters matching those in the SP.

However, I want the user to enter DATE parameters and not DATETIME parameters.

EG I want the use to enter @From = 01 Jan 2003 , @To = 31 Jan 2003.

To work this needs to be passed to the SP as '01-Jan-2003 00:00:00' and '31-Jan-2003 23:59:59'.

Any tips?

Thanks,

Paul
 
There are a few limited options.

One is to not use an SP, rather a View, and let the where clause pass the date data.

Another option is to create parmeters of a different type, such as varchar(), and then cast/convert them within the SP.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top