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 gkittelson 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 date parameter to Stored Proc from Crystal

Status
Not open for further replies.

Plato2

Programmer
Dec 6, 2002
192
US
I'm trying to pass to dates parameters to my stored proc.
My stored proc accepts 2 params (StartDate and EndDate).I use Crystal 8.5 version.

Report always asks to enter date and time. I need this report to asks for dates only. How Can I do that?

Thanks in advance.
 
What's your back end?

If it's SQL Server, there isn't a pure Date datatype, hence Crystal asking for Date/Time. Two workarounds:
1) Change the stored proc parameter to a string, and use the prompting text in CR to indicate the format the users should enter the date
2) Handle the time portion in the procedure.

My personal preference is to handle it in the procedure to avoid funky parameter entry. My users are trained up to ignore the time portion.

-dave
 
That's one of the real nuisances of SP's in Crystal, you lose control over your parms.

I tend to use Views unless there's an overiding performance advantage. With Views you can use a Crystal parm and pass it to the database (along with optimized SQL).

Dave is dead on with regards to SQL Server, if you're using Oracle or a database which supports a DATE only data type, change the SP.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top