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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to add 2 times together

Status
Not open for further replies.

GlenLynam

MIS
Jul 26, 2002
121
Hi there,

I have 2 times from 2 queries the format is hh:mm:ss. I need to add these times together ie the times 10:00:00 and 10:00:10 would become 20:00:10. Ok i can get it so the results are hh:mm:sshh:mm:ss. I have this isn the query and feel it should work as it is how i got the durations from the data in the first place.

Total: Format(Sum(TimeValue(qryTSOut_Duration!totalcall+qrytsin_duration!totalcall)),"hh:nn:ss")

but it tells me it is to complicated and i should add some variables any ideas??

Thanks

Glen

ps. Incase it helps here is the SQL code

SELECT [SMDR In Order].Party1Name, qryTSOut_Duration.TotalCall, qryTSIn_Duration.TotalCall, Format(Sum(TimeValue([qryTSOut_Duration]![totalcall]+[qrytsin_duration]![totalcall])),"hh:nn:ss") AS Total
FROM ([SMDR In Order] INNER JOIN qryTSOut_Duration ON [SMDR In Order].Party1Name = qryTSOut_Duration.Party1Name) INNER JOIN qryTSIn_Duration ON [SMDR In Order].Party1Name = qryTSIn_Duration.Party1Name
GROUP BY [SMDR In Order].Party1Name, qryTSOut_Duration.TotalCall, qryTSIn_Duration.TotalCall
ORDER BY qryTSOut_Duration.TotalCall DESC;
 
Hi,

Code:
Format(Sum(qryTSOut_Duration!totalcall+qrytsin_duration!totalcall),"hh:nn:ss")


Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
Thanks for the response but im geting the same message about it being to complicated and that i should assign some variables. Any other ideas??
 
And this ?
Format(qryTSOut_Duration.TotalCall + qryTSIn_Duration.TotalCall, 'hh:nn:ss') AS Total

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Nope but i have cracked it!!! After 2 days of trying!

Total: TimeValue(qryTSOut_Duration.TotalCal)+TimeValue(qryTSIn_Duration.TotalCal)

Thanks to all for your assistance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top