Our company has imported several thousand records into an SQL Server database. The problem is that the dates have come through in a less than ideal format, so for example the date 27 November 2002 has come through as 20021127, and this is stored as a Decimal data type.
I have found that in SQL using
in the query will work fine and format the date properly.
However I want to pass the results of this query to a Crystal Report using Active Data. If I point my report at this query to create the report definition it tells me there is an error converting the data type. If I leave it then I get dates looking like 20021127 in my report.
Is there a way either to make Crystal accept that the SQL query is correct, or to format this number as a proper date i.e. 27/11/2002
Many thanks
Stuart
I have found that in SQL using
Code:
convert(datetime , convert(varchar,yourfield), 103)
However I want to pass the results of this query to a Crystal Report using Active Data. If I point my report at this query to create the report definition it tells me there is an error converting the data type. If I leave it then I get dates looking like 20021127 in my report.
Is there a way either to make Crystal accept that the SQL query is correct, or to format this number as a proper date i.e. 27/11/2002
Many thanks
Stuart