Create an expression for numbers returned by a query

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

A query returns the numbers 22,23,24,34,35,36.

I need a function that will return 22-24, 34-36

Thanks for all help!

Tom
 
I think you'll need to group based on Integer division by 10 then do your
Min and Max on this grouped data. Something like....

SELECT Min([NumField]) & "-" & Max([NumField]) AS Range
FROM tblYourTable
GROUP BY [NumField]\10

Maybe, tblYourTable should be replaced by your existing query's name

HTH
Sam
 
Back
Top