cancel
Showing results for 
Search instead for 
Did you mean: 

Can you convert datetime fields into date fields within the dynamic parameters (versionXI)

Former Member
0 Kudos

Post Author: davinap

CA Forum: Data Connectivity and SQL

Does anybody know if you can convert datetime fields into date fields when using the dynamic parameters? I have converted the datetime fields to date fields in the Format Editor (through File | Options) but this has not made a difference. I just want the parameter to look neater when the user goes to select the date that they want.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Post Author: V361

CA Forum: Data Connectivity and SQL

Yes you need min & max, both, select date as your param type, and do not make your list of values dynamic, use static instead you can use prompt text to give the users valid Min_date / Max_date values if you want. You are actually passing{? min_date} and adding the time string 00:00:00 to it, then you do your {? max_date} and time string 23:59:59 and you should get from 00:00:00am on min_date to 23:59:59 on max_date.

Former Member
0 Kudos

Post Author: davinap

CA Forum: Data Connectivity and SQL

Hi Again,

I have just tried adding 2 new (date) parameters of min_date and max_date and added the formula into the select expert, if I then try and edit the original parameter (linking dynamically to the datetime field in the database) it is still looking at the field in the database which is a datetime field. I am not sure if crystal can actually change the data type when it is linking to the database? I may just have to hard code the dates and they will have to add to them each month? Or just type when they run the report?

Any more help is very welcome.

Thanks,

Davina

Former Member
0 Kudos

Post Author: davinap

CA Forum: Data Connectivity and SQL

Hi V361,

Thank you for the reply. Please could you explain a little futher for me?

Is {iApplicationStat.Timestamp} the datetime field that you are using to link to within the parameter? Do you then need to create 2 new parameters of Min_date and Max_date? Also all the times that are in the datetime fields only have a time of 00:00:00, so do I still need to do 2 new parameter fields? And is this in the select expert?

Thank you,

Davina

Former Member
0 Kudos

Post Author: V361

CA Forum: Data Connectivity and SQL

I think this will work, I have used this type of formula in the past.

{iApplicationStat.Timestamp}

= {? Min_Date} +Time (08,00 ,00 )

to {? Max_Date} +Time (16,15 ,00 )

then change your parameter to Date, instead of date time. Of course in this example the report time is from 08:00 to 16:15 End result customer will only need to select a date.