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

Access - sort/order by after a query has been grouped - subquery??

Status
Not open for further replies.

cafulford

MIS
Oct 14, 2009
30
US
Hi, I have an existing query ( that I would like to sort by the date/time the record was entered into the table bl_file that feeds this query. I have a date/time field called TIME_REC_CREATED.

I added this new field TIME_REC_CREATED to the group by but because my group that is actually the "key" used in a subsequent print routine, it messed up the group which is only supposed to be carrier/trailer # so what I need to do is be able to keep the group the way it originally was, then be able to sort by TIME_REC_CREATED within that group. I have been researching for a long time and I think "maybe" a subquery would work but I have tried all sorts of iterations and can not come up with proper syntax.

I am still learning Access so the more detailed an answer you can give, the better.

Please see for record layout. The existing query is:

SELECT CARRIER_NA & TRAILER_NU & " ( " & Count(*) & ")" AS Display, bl_file.CARRIER_NA, bl_file.TRAILER_NU
FROM bl_file
WHERE (((bl_file.BL_NUM) Is Not Null) AND ((bl_file.PRINTED)=0))
GROUP BY bl_file.CARRIER_NA, bl_file.TRAILER_NU
HAVING (((bl_file.CARRIER_NA) Is Not Null) AND ((bl_file.TRAILER_NU) Is Not Null));


Thanks in advance for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top