I have a date field which has the type number (20021205/year,month,day). I have to convert the number field into date field and want to use the parametric date inquiry.
I am not sure what you mean by " parametric date inquiry" but to convert the string "20021205" to date see the formula below. In my example D_DATE is the column, T_TABLE is the table.
Date (val({T_TABLE.D_DATE}[1 to 4]),val({T_TABLE.D_DATE}[5 to 6]),
val({T_TABLE.D_DATE}[7 to 8]))
If the intent is to use a parameter to limit the rows, the intent and solutions here are not optimal.
Since the data is stored as a string, create a date range parameter, and then convert the date parameter to a string and use that in the record selection formula, otherwise all processing will be done in Crystal, which can be punishingly slow.
So for the record selection formula, try:
{table.datesring} >= totext(minimum({?Daterangeparm}),"yyyyMMdd"
and
{table.datesring} <= totext(maximum({?Daterangeparm}),"yyyyMMdd"
Always check the Database->Show SQL Query to determine if it's being passed to the database.
If it's not a date range parm, eliminate the minimum().
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.