Print Page | Close Window

calculate end time

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22774
Printed Date: 27 Apr 2024 at 11:46pm


Topic: calculate end time
Posted By: sanchezgmc06
Subject: calculate end time
Date Posted: 17 May 2019 at 10:27am
hello

I need help in how to calculate the end time.

I have the following 2 fields
Start_time
Duration (in minutes)

now i need to calculate at what time did the service end based on the start time and duration of the service

thanks for your help



Replies:
Posted By: DBlank
Date Posted: 17 May 2019 at 10:30am
is it a datetime field or only a time field.
if only time how do you indicate when something ends on the next day?
generally though you can use dateadd()

DATEADD('n',{table.duration},{table.start_time})


Posted By: sanchezgmc06
Date Posted: 17 May 2019 at 11:17am
The duration will usually be between 20 minutes to 4 hours (in minutes) and will not go into a different date.


Posted By: DBlank
Date Posted: 20 May 2019 at 2:28am
what is the data type of Start_time?
Duration is a number/int field type?



Print Page | Close Window