|
-
Jun 7th, 2006, 08:39 AM
#1
Thread Starter
Frenzied Member
Access Sum Statement when using Time (RESOLVED)
Had a look searching for this but not really what i wanted
have this
SELECT *
FROM Production
WHERE Production.Line = 'D4'
AND Production.Shift = 'B'
AND Production.Date = #07/13/04#;
displays
Run Time
01:45
03:30
03:05
01:20
00:45
however when run
SELECT SUM([run time]) AS ["Run Time"]
FROM Production
WHERE Production.Line = 'D4'
AND Production.Shift = 'B'
AND Production.Date = #07/13/04#;
it displays
"""Run Time"""
0.434027777777778
so i think the formating of the result needs doing but how do i do this in access?? any help please thanks in advance
would be greatful
put this into excel and the numbers added up give the 0.43 but want to add as time, not a number, any help thanks
Last edited by Hack; Jun 7th, 2006 at 08:57 AM.
Reason: Added green "resolved" checkmark Last edited by Robbo : Today at 09:51 AM.
-----------------------------------------------
"The hall is rented,"
"the orchestra is engaged,"
"its now time to see if you can dance!"
Q, Q-Who, Star Trek The Next Generation
-----------------------------------------------
General Work day

-----------------------------------------------
DOS, Win 95, Win 98 SE, Win ME, Win NT 4.0 SP6a, Windows 2000 SP3, Window XP SP1, Windows 7, Windows 8/8.1, Windows 10, Office 97 Pro, Office 2000 Pro, Office 2010, Office 2013, Office 2016, Office 2019, Visual Basic 6 (SP5), SQL, Oracle
-
Jun 7th, 2006, 08:44 AM
#2
Re: Access Sum Statement when using Time
Try this amendment:
Code:
SELECT Format(SUM([run time]),"hh:nn") AS ["Run Time"]
...
As dates/times are stored as numerics internally (the Integer part is the date), this should work nicely.
-
Jun 7th, 2006, 08:49 AM
#3
Fanatic Member
Re: Access Sum Statement when using Time
try this
SELECT cdate(SUM([run time])) AS ["Run Time"]
FROM Production
WHERE Production.Line = 'D4'
AND Production.Shift = 'B'
AND Production.Date = #07/13/04#;
-
Jun 7th, 2006, 08:51 AM
#4
Thread Starter
Frenzied Member
Re: Access Sum Statement when using Time
 Originally Posted by si_the_geek
Try this amendment:
Code:
SELECT Format(SUM([run time]),"hh:nn") AS ["Run Time"]
...
As dates/times are stored as numerics internally (the Integer part is the date), this should work nicely. 
thats it great thanks very much, knew wasnt far off, cheers
-----------------------------------------------
"The hall is rented,"
"the orchestra is engaged,"
"its now time to see if you can dance!"
Q, Q-Who, Star Trek The Next Generation
-----------------------------------------------
General Work day

-----------------------------------------------
DOS, Win 95, Win 98 SE, Win ME, Win NT 4.0 SP6a, Windows 2000 SP3, Window XP SP1, Windows 7, Windows 8/8.1, Windows 10, Office 97 Pro, Office 2000 Pro, Office 2010, Office 2013, Office 2016, Office 2019, Visual Basic 6 (SP5), SQL, Oracle
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|