Thursday, November 10, 2005

Dates from Heat in Crystal

Crystal Report Designer is a great reporting tool, but unfortunately the design of the HEAT database doesn't always make it as simple as possible to create reports. For example, dates in the HEAT database are held in string fields not standard date/time fields of the database you are using. This means that you need to convert the fields before they can be used with all the standard date functions in Crystal. There are two options you have for doing this : -

1. HEAT Crystal Functions
Shipped with installer for HEAT are a set of functions to allow you to do functions in Crystal that are specific to the HEAT system. One of these functions is HFWDateToDate. This function converts a HEAT date field into a Crystal Reports date field. For example if you wished to change the CallLog.RecvdDate the formula would be :
HFWDateToDate({CallLog.RecvdDate})
2. Standard Crystal Functions
Often you want to use crystal reports on machines that may not have the Heat Functions installed. In this case it is necessary to convert the date using standard Crystal Functions. The problem that sometimes occurs with using the standard Crystal is when targeting a date that may not be filled in (for example CallLog.ClosedDate). This will cause a 'Bad Date String format' error. This can be solved by simply checking the field has a valid date format before converting the value. For example if you wished to change the CallLog.RecvdDate the formula would be :
IF ISDATE({CallLog.RecvdDate}) THEN DATE({CallLog.RecvdDate})

1 comment:

cgriffin said...

I'm trying to build a formula that counts the number of Calllog.callid that are related to other Calllog.callid using a custom field that relate one call record to another.

Anyone know how I can build such a formula?