Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date field appears as string...!!!

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
0
0
US
I have a field with datetime as datatype. I create a dictionary with that table. Now in the dictionary it is showing as a string !
How will I fix it ? I need to filter data based on this field in the report.
Please help
 
I suggest that people stop using dictionaries anyway. Crystal is supposed to be dropping them in the future.

You might want to share some information when you post, such as Crystal version, database and version, what's in your Dictionary, etc.

I'd just drop the tables into Crystal and do your joins and record selection formula there, the dictionary really isn't buying you anything.

-k
 
The customer needs a crystal dictionary. So I am preparing it and sending it.

I am using Crystal Reports Version 9. The dictionary version is latest ( That comes with Data compatability tools )

I am using SQL Server 2000 as database.
The reports have 2 - 3 tables and I have linked it. The issue is when I display a date field ( which is datetime format), it is showing as a string field.

I need to create a formula in the Crystal Dictionary itself using Date() or so, so that when I use that field from the dictionary it shows datatype as date !
 
You can always convert it in the report using date().

I just tried it and the same thing happened for ODBC, OLE DB and ADO, and it appears that Dictionaries don't support datetimes, so you may have to do this on the report side.

-k

 
Kutoose

This might not be an issue any more but I have just been looking at dictionaries and found that you can pull dates into Crystal Reports as dates.

To do this open the dictionary and goto FILE/OPTIONS. In options select the 'SQL OPTIONS'. At the bottom you should see 'Convert Date-Time field to date', tick this box and OK the selections. When you save the dictionary and load it into Crystal reports the field which contains the date should be a Date object.

I had a DateTime field within my dictionary which was showing as a string in CR v8.5. When I did the above the field became a Date type within CR.


Lewis
United Kingdom
 
Lewis: Try using a SQL Expression and CAST it to a datetime, it's faster and you don't go through the problematic and no longer suggested layer of dictionaries.

-k
 
Synapsevampire

Thanks for the suggestion. Normally I do not use dictionaries. I have created this one because someone in the ultimate wisdom has deemed that I should train several supervisors in my department to use Crystal Reports. Given that there abilities of writting reports is somewhat lacking the dictionary seemed to be the easiest way to give them access to the database.

Lewis
United Kingdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top