Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Passing date parameter to crystal from stored proc Post Reply Post New Topic
Author Message
dbodell
Groupie
Groupie
Avatar

Joined: 08 Nov 2011
Location: United States
Online Status: Offline
Posts: 53
Quote dbodell Replybullet Topic: Passing date parameter to crystal from stored proc
    Posted: 23 Nov 2011 at 7:18am
I know this has been asked before but I haven't been able to find an answer to this. I have Crystal 2008. I have a stored procedure which I am using as the source of my data. There are two dates in my stored procedure as parameter variables. One is FromDate and the other is ToDate.
When I define these date fields in the stored proc as type DATE, Crystal brings the parameters in as strings, making them useless for entering parameter values with a calendar control.
 
When I define the dates as DATETIME fields, Crystal interprets them as dates but requires that the time be entered along with the date.
 
This seems like a really stupid problem with Crystal, especially since SQL 2008 introduced the DATE datatype. But given that it is a problem, has anyone got a workaround somehow? I need to restrict the data on the server because of performance issues.
 
Thanks in advance for any help.
Thanks,
D. Bodell
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Nov 2011 at 11:47am
yeah, what a pain.
 
if you want to use the calendar control, use datetime. When the user selects a date, CR will put the time component in...it's only entering it manually that is a pain.
 
In your stored proc, strip off the time compent as needed or convert it to a DATE.
 
Yes, SQL 2008 has Date, but do all the other data sources that CR supports?  There are an awful lot of back ends that CR supports so I can't completely vault them for making a rule...I do wish that they would interpret a date without a time as 00:00:00 and make everyone's life easier.
 
HTH 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.