Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add two timefields

Status
Not open for further replies.

3543e6

Technical User
Feb 22, 2002
4
NL
Hi,

I'm using crystal 8.5 and i want to add two timefields with each other.

For instance:
starttime 8:20
duration 1:46

result should be 10:06 and it should also be a timefield like starttime and duration.

Can anyone help me with this?

Thanks
 
Surprisingly, the command is DateAdd. The database I work on doesn't use time, but DateAdd ("n", duration, starttime) should do it.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
First convert {table.duration} into minutes by creating a formula {@duration}:

hour({table.duration})*60 + minute({table.duration})

Then use the dateadd function like this, since it requires a datefield:

time(dateadd("n",{@duration},datetime(currentdate,{table.starttime})))

-LB
 
lbass,

Thanks for your respons. That did it for us. Great!!

regards,
3543e6
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top