Formatting question

W

Wylie C

I have a query that looks at another query field called Tseconds. The query
calculates three values from the Tseconds field: Hours, Minutes and seconds.
The problem I have is that if the minutes and seconds are less than 10, then
only the single number is displayed. For example I get 2:3:1 instead of
2:03:01. I have worked at different formats with no avail. Below is the code
I am working with...

SELECT DISTINCTROW Year([Statistics].[StatDate]) AS [Year],
Sum([Statistics].[Mileage]) AS [Timed Miles Ridden], Sum([Statistics].[Total
Miles]) AS [All Miles Ridden],
([qryYearlyMileageTotalsTrial]![SumOfESeconds]\3600) & ":" &
(([qryYearlyMileageTotalsTrial]![SumOfESeconds] Mod 3600)\60) & ":" &
([qryYearlyMileageTotalsTrial]![SumOfESeconds] Mod 60) AS [Hours Ridden]
FROM Statistics, qryYearlyMileageTotalsTrial
GROUP BY Year([Statistics].[StatDate]),
([qryYearlyMileageTotalsTrial]![SumOfESeconds]\3600) & ":" &
(([qryYearlyMileageTotalsTrial]![SumOfESeconds] Mod 3600)\60) & ":" &
([qryYearlyMileageTotalsTrial]![SumOfESeconds] Mod 60),
Format$([Statistics].[StatDate],'yyyy')
ORDER BY Year([Statistics].[StatDate]) DESC;

Thank you.
 
A

ACG

Don't know if this will work but you could try:
& Format((([qryYearlyMileageTotalsTrial]![SumOfESeconds]
Mod 3600)\60),"00") &

and then the same on the other fields
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top