Query Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hope I can explain this correctly.

I have a database that looks like this:

Record# Type Time
1 12345 93000
2 12345 93300

I am trying to build a query that will produce this result:

Record# Type Time
1 12345 0:03:00

For each Type, there will usually be 2 records. For each type, I am trying
to tabulate the difference in Time. I think I may need to reformat the Time ?

Is this possible using a query ?

Thank you in advance.
 
SELECT Carl.Type, Min(Carl.[Record#]) AS [Record#],
Format(Max([Time])-Min([Time]),"00\:00\:00") AS Expr1
FROM Carl
GROUP BY Carl.Type;

A lot depends on how you have your data stored and what it means. 93300
doesn't really make for recognizable date or time.

Also both Time and Type are reserved words in Access. If you ever get
anything strange happening, it could be due to those words. I recommend
renaming them something like TypeJob and TimeElapsed or something more
meaningful to you.
 
Back
Top