cancel
Showing results for 
Search instead for 
Did you mean: 

How do i use a date parameter in this case?

Former Member
0 Kudos

Hello.

We have this problem in our company:

We are running a firebird database and i am using a date field as a parameter in the report.

But i only can use a string-parameter instead of a date field though it is a date data type in the database.

The reason seems to be that crystal report is sending the parameter formated like this:

Date(10.10.2008)

if i add it in the query like this

{?date}

i get a convert error (seems like our db cant use convert), if i add it like this

'{?date}'

i get an error message, unknown token

So what can i do now? I want to use a date parameter to use the calender function, that would be much better for our customers. So far i have to type the date manuelly and the report is functional but a real date function is missing now.

Hope someone can help me im looking forward to your replies.

P.S. dont know if its important, i am using Crystal Reports 2008 Version 12.0.0.683

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

This is a known issue and will be fixed with SP3

Former Member
0 Kudos

Ok i try to describe our problem a bit more detailed.

SELECT VD.DATUM, .....

FROM VORGANGSDOKUMENT VD

WHERE VD.DATUM >= '{?DATUM_FROM}' AND VD.DATUM <= '{?DATUM_TO}'

this a part of the query. The datafield is DATE type, also i want to use the parameter as DATE type.

The Parameter has to be in form like '10.10.2008' .

So far i have to use a STRING type parameter because DATE type is not working.

Edited by: Markus Klimaschewski on Dec 29, 2008 4:34 PM

Former Member
0 Kudos

Okay.

Create a DATE parameter and make it a RANGE parameter.

Then create your record selection formula as follows:

CDATE() in {?DateParameter}

Former Member
0 Kudos

Hi. Thanks for your reply.

I cant use this way to solve my problem, because we have some millions of records, so i need to filter them in the sql server first, otherwise the report would run for hours before i can see first results.

Former Member
0 Kudos

Any ideas anyone?

Former Member
0 Kudos

try something like this in the stored procedure

CONVERT(datetime,CONVERT(char(10),,101))

>= CONVERT(datetime,CONVERT(char(10),@fromdate,101))

Former Member
0 Kudos

Our Database cant use CONVERT.

Is there any possibility to view the query Crystal Report creates, using the DATE parameter, i know i can see the query when its successful, but without the exact values. Or can i modifiy the statement Crystal Report creates when im using a DATE parameter?

Former Member
0 Kudos

why cant you use convert?

did you build the parameters in the stored procedure?

go to database

show sql query, unfortunately this probably isnt going to show you what you want to see.

Former Member
0 Kudos

I cant use convert, because our databse dont support it.

The parameters i am using are just from the crystal report query. The problem is that the parameter-format crystal reports is using for a date parameter isnt working on our database, if i would know what crystal reports is exactly using as query i could use substring to get the parts of the parameter our database is understanding.

Former Member
0 Kudos

can you go to set database location and see the name of the query? it should also show you the location

Former Member
0 Kudos

You may want to make your parameter a DATE parameter then create a record selection such as this:

CDATE() = {?DateParameter}