Sum hours

  • I'm creating a adp front end in access from a mdb, with a sql 2000 back end. In the old mdb i had a form that held sessions that lecturers worked and in the form footer i had a text box which had a control source =Sum([hrs])*24 and this worked fine. now in the adp this does not work the field just returns error. Can anyone give me any advice on this please.

  • Michael,

    The conversion process from MDB to SQL may have created a different field type. Check that it is a numeric field. Also - in case there are nulls use the NZ function ie sum(nz([hrs],0).

    Why use an ADP anyway?  Why not just link the tables and use DAO - its faster from tests that I've tried.

     

    Richard

     

  • The hrs field is a short time field

  • You mean smalldatetime?

  • Try something like this in the datasource of the textbox :

    =DateDiff("h";[StartDate];[EndDate])

    then at the bottom of the report you should be able to use sum([txtboxname])

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply