Hi Jimmy,
I think you have two choices here:
[1] A simple select statement with an 'order by' ShipDate, VehicleNumber,
Size.
This would return a sorted listing of every record.
[2] A 'group by' statement:
Select ShipDate, VehicleNumber from tablename Group By ShipDate,
Vehicle Number.
In this case you must omit the Size field.
Suggest you try both, look at the listings and see if either will meet your
needs.
HTH -Linda
"Jimmy Tran" <hunganh20@yahoo.com> wrote in message
news:414b4027$0$26153$c397aba@news.newsgroups.ws.. .[color=blue]
> Hello everyone,
>
> I have a table with many columns. Two of them are VehicleNumber and
> ShipDate. What I would like to do is sort all the data in ascending
> date(ShipDate) but I also like to group the matching VehicleNumber
> together at the same time(If they have same ShipDate; please note
> grouping here means putting them in adjacent rows). VehicleNumber does
> not need to get grouped together when they have different ShipDate. I
> try simple queries but I keep getting "VehicleNumber not part of
> aggregate function" and etc. Maybe my problem is because I am trying to
> group VehicleNumber while my other fields have different values, as you
> can see for example the Size column.
>
> my sample table:
> VehicleNumber ShipDate ... Size
> 123 9/9/2004 5
> 434 9/10/2004 5
> 123 9/9/2004 16
> 123 9/13/2004 4
>
> my output query:
> VehicleNumber ShipDate ... Size
> 123 9/9/2004 5
> 123 9/9/2004 16
> 434 9/10/2004 5
> 123 9/13/2004 4
>
> Thank You a whole lot for helping me out.
> Jim
>
> *** Sent via Developersdex
http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]