Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005

    Unanswered: Subtracting Date/Time stamps...

    Is it possible to subtract time/date stamps field (number), then have it output the correct number of days and the time difference? I have one in place now and it only spits back a goofy numeric. Here is my current formula:
    {tblResponse.EndTimeDate} - {tblResponse.StartTimeDate}
    Any suggestions would be great. Thanks!!

    M. Anderson

  2. #2
    Join Date
    Oct 2005
    Crystal may not be recognizing the correct datatype of your database fields i.e., date type.
    Try this expression below and display the resulting value in your form and if shows coherent values, then check data type. You can't use integer type when working on date values.

    NumberOfdays = Now() + 2

    I just figured it out
    here it is

    Make sure your fields data type is date time and here's the formula you need to create. After creating the formula, set the fomat to 24 hour. You can't find this in Crystal Help Section. So save it somewhere for future reference.
    See attached image


    Time(0,0,0) + (Time({tblCurrentUsersFS.OUT})-Time({tblCurrentUsersFS.IN}))
    Attached Thumbnails Attached Thumbnails time.bmp  
    Last edited by fredservillon; 12-02-05 at 13:28.

  3. #3
    Join Date
    May 2004
    use the DATEDIFF function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts