lundi 20 avril 2015

crystal reports 2008 convert string to date time (SQL)

Good day; Recently our software developer made a change to the time and date tables, which resulted in these fields being separated and changed to a "string" format. Now none of my time formulas will display. I emailed them for help and they sent me a SQL expression that looks like this:

CAST   (
    CONVERT(Varchar(10), ATCC_Contacted, 112) + ' ' +   
    CONVERT(Varchar(8), ATCC_Contacted_Time) AS DateTime)

I have attempted to insert this into the report, but it returns a warning; "Failed to retrieve data from the database." and "Failed to retrieve data from the database. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. SQL State: 22007 Native Error: [Database Vendor Code: 242] I am way out of my depth on this one, and would appreciate any advice given. Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire