I have a few reports that access stored procedures. However, we'd prefer to use a Date parameter and not a DateTime. Is there a way to do this in Crystal 10 or by modifying the stored procedure?
Try posting technical information in the future (Crystal version,database used), it doesn't take much more of your time and not doing so is disrespectful of people's time here.
I am dealing with the exact same issue at the moment. The field we are using has a TO_DATE on it and all we need is a DATE parameter passed to the Oracle Stored Procedure. The IN paramters are both DATE as well.
I tried defaulting in the parameter within Crystal to 12:00AM on both STARTDATE and ENDDATE but my VB app passing the values back to the report didn't take it well.
I would be glad to here any ideas on this as well.
I am doing a TO_DATE just because the field is a DATE TIME and I am converting to just DATE. Regardless, saying PARAMETER IN DATE should only require Crystal to pass a DATE parameter, not a DATETIME.
It seems like we are skirting over the real issue here.
I have figured a temproary workaround to comfort my users as it relates to data.
I am setting the default picklist value for the START DATE to 1/1/2007 12:00:00AM and the default picklist value for the END DATE to 12/31/2007 11:59:59PM and just advising them to change the dates and not times.
Hi,
To convert a DateTime field to just Date it is simpler ( and probably a llttle faster) to use TRUNC, not To_DATE...
If TABLE.DATE = 12/31/2007 12:00 AM then
TRUNC(TABLE.DATE) would return 12/31/2007
- IIRC, when using a SP, Crystal will match the parameter type to the field it is being used as a criteria for, not how it is defined in the IN clause , hence DateTime.
To Paraphrase:"The Help you get is proportional to the Help you give.."
I tried this by editing my source view to TRUNC(TABLE.DATETIME) AS X_FUNDDATE
Then in my Stored Procedure I did:
STARTDATE IN DATE
ENDDATE IN DATE
WHERE X_FUNDDATE >= STARTDATE and X_FUNDDATE <= ENDDATE
I then verified database in Crystal report to catch the update of the stored procedure, yet it still prompts for datetime and I cannot change the parameters to anything else.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.