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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime field shown as a string

Status
Not open for further replies.

SteveFairclough

IS-IT--Management
Oct 31, 2001
50
GB
Can anybody tell me why my report is seeing DateTime fields as strings.
I've set the option in the Reporting tab of Options to "keep date-time type" and in Report Options I've set the Convert Date-Time option to "To Date-Time".

If I change both of the above to see the fields as just date fields then that's what I get - just date field. However, I need to see the times as well.

Here's my spec if it helps :-
Windows 2000
Crystal Reports 7 (MR1)
Access 97 database via ODBC (it has to be ODBC!)
The field I'm reporting on is definately a Date-Time field, not just a date field.

Any help would be appreciated.
 
Hi,

If your field is a date_time field then what is displayed when you use the formula...

totext({field},"yyyyMMdd hh:mm:ss")

Does this still only show the date?

Also check your CR options to see what the Fields Tab is set to for DateTime button. It may be set to Date there instead of Date Time.

Hth,
Geoff
 
Geoff, thanks for the suggestions but I still can't get it to work.

The DateTime button in the Fields tab IS set to DateTime.

I tried the formula but it gave me an error about having too many arguments in the function.

When I just hover the mouse over the field in the report design or preview, the field type (in brackets) is always a string. This is regardless of any of the date_time settings in the Options and Report Options. However, if I set all the options to Date rather than DateTime, it still shows as a string in the field type but I do get Date formatting options when I go into the Format Properties of that field.

It's really bizarre and I just can't figure it out.

Any other ideas ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top