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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass a SP date parameter to CR XI 1

Status
Not open for further replies.

Twain35

Technical User
Sep 2, 2010
5
US
I have a stored procedure that has an start date and end date paramters as nvarchar data types and I believe it is going to create a problem when I run it in crystal reports. The date parameter is under the

create stored Proc (@A nvarchar(10), @B nvarchar(10), @startdate nvarchar(10), @enddate nvarchar(10))
as
Declare @x nvarchar(1000)
set @x = select A from B where Datefield < Start date and < end date

this is the only way the date input works, so question s what would be the work around if crystal displays an error with the date paramter? Any help will be appreciated.
 

Why do you think it will be a problem? Have you tried it, and received an error?

You may want to consider changing the input parameters to dates, and then converting those dates to text in the body of the sp. That way the user can take advantage of the calendar controls in Crystal, and you don't have to rely on the user entering the dates in a particular format.
 
Thanks for the reply. It actually worked. Only thing is the user has to enter the date in the right format. I tried changing the date parameters in the sp but nothing worked, so i am taking the current option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top