How to create and display a calculated date &time field

Hi,

I am having a problemwithcreating a new"Total Hours spent"column to the Sample Schedulable User Billing Report with Grand Total. The total hours spend is the difference betweenthe Labour Service start date &Timeand service stop date & Time. This is either displayed in hours or minutes. This will help to identify some discrepancies on the truenon chargeable timefor the technician

I would also like to break the group by date if possible. So I can see my daily hours total.

Many thanks,

Raymond Widjaja

Hi Raymond

I will have to get back to you on this - I’m pretty sure there is C# code to subtract date/time values from each other, and will have to play with it to determine exactly how it could be done.

  • Joyce

Hi Raymond

I have posted a new sample report template at http://forum.ayanova.com/Topic3035-103-1.aspxthat shows using a OnBeforePrint script for a field to subtract the Service Start Date & Time from the Service Stop Date & Time.

As groupings via the report template are based on a single datafield and either the Service Start Date & Time or the Stop Date & Time is a specific time of a specific date, it is not possible to set a grouping for an entire day. I would suggest that if you want to view hours for a specific day, that you set a custom filter selecting greater than and less than (example check out http://forum.ayanova.com/Topic1430-100-1.aspx?Highlight=greater+thanto display all records for a specific day for the user, and than select to print.

  • Joyce

Thank you Joyce.

The report does the trick. I can use it as a base.

As to the grouping, is there away to group by week or month within a filter date range ? Curently Ihad to generate the reportfiltered by each week or month date-range.

Raymond.

Hi Raymond

Refer to the topic http://forum.ayanova.com/Topic1430-100-1.aspx?Highlight=greater+thansuggested above, which shows an example of how to create a custom filter selecting Operator of Less than or equal to and Operand of last date of service of the range you want to report on; and Operator of Greater Than or equal to and Operand of first date of service you want to report on.

The grid will than show all records that have this date between the two dates selected.

  • Joyce