I am looking to change the format in a static date prompt on a report from YYYY MM DD to DD MM YYYY, is this possible? I have attempted a number of methods after reading the article below but I am unsure of exactly what I am doing.
Hi Andy, To either have the option to free type or select from the calendar. At the moment the prompts are set up to take either in the format YYYY-MM-DD.
A parameter will prompt in a different way depending on the datatype. If you set it as a date parameter it will give you the calendar, set to text\char it will give you free text.
Which one are you using and what is the data type of the column in the DB that you`ll be using the parameter with for filtering?
You can use the parameter field in a formula and convert it to a string and do anything with it basically. You can then use this variable\formula in record selection or whereever you need to. Performance won`t be good though as all data will have to be parsed through that formula if you use it in a record selection formula.
So it basically boils down to how the date is stored in the database(SQL server)? And am I right in saying that there are no conversion date functions within Cyrstal XI? In a business objects universe I would be able to convert the date format using the SQL server function convert.
You can use that function in Crystal Reports if you use an SQL Expression field…
Or connect the report to the same Universe!
All convert will do is turn the Datetime value to a date string formatted how you want it. You can still do that in the Crystal report formula language.
Best way is using an SQL Expression field though, better performance.
Apologies for my naivety but still struggling with this, I looked at using convert function in a SQL expression but the function available only seems to allow for 2 paramenters rather 3 in SQL Sever/Oracle.
Andy you mentioned that you can use Crystal report formula language to format a date, are you able to do this but still keep the data type as a date so I can still use it as a prompt with the calendar?
I have the following code in the selection formula and wish to have the date coming back as DD-MM-YYYY rather than YYYY-MM-DD
{DATE}>={?Start Date} and
{DATE}<={?End Date} and
{State} = “Closed”