Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Technical Questions
Message Icon Topic: calculate end time Post Reply Post New Topic
Author Message
sanchezgmc06
Groupie
Groupie
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 99
Quote sanchezgmc06 Replybullet Topic: calculate end time
    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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8996
Quote DBlank Replybullet 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})
IP IP Logged
sanchezgmc06
Groupie
Groupie
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 99
Quote sanchezgmc06 Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8996
Quote DBlank Replybullet Posted: 20 May 2019 at 2:28am
what is the data type of Start_time?
Duration is a number/int field type?
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.