If I understand correctly, you want to extract from the description three
particular text strings for grouping the data. That makes what you want to
do cumbersome, but not impossible. It would be much better structure to
have the "Type of Container" as a separate field, particularly if the
description is typed by hand... if so, it will not be long before you get
"Drt Emptu..." or "Fill..." or "Tanshipment".
If you are, for some reason, _compelled_* to take the chance on data entry,
you can use a Query with Calculated Fields for each Type, eg,
DryEmpty: If (InStr([DESCRIPTION], "Dry Empty")<>0,1,0)
and
Full: IIf (InStr([DESCRIPTION], "Full")<>0,1,0)
and
Transshipment: IIf (InStr([DESCRIPTION], "Transshipment")<>0,1,0)
And use the Sum function for each in the appropriate Footer (Group Footer or
Report Footer).
* do not let yourself be lulled by the thought that your data entry
will be careful and not make mistakes
Personally, I'd have a Combo Box on the Input Form to select "Type of Load"
(and another for "Inbound or Outbound" if you are going to use that value)
so that the user can choose but cannot mistype. I'd still have a calculated
Field in the Query, but the calculation would be different.
Also, I believe "Description" is an Access reserved word, and suggest you
change that field name to something like LoadDescription to avoid possible
confusion or conflict.
Larry Linson
Microsoft Access MVP
tom said:
Dear Larry,
I would like to give the actual figure as below:
ETD DESCRIPTION AMOUNT
7/1/2007 40' Dry Empty Container Inbound $1,138.00
7/1/2007 20' Full Container - Inbound $191.00
7/1/2007 40' Full Container - Inbound $861.00
7/1/2007 45' Full Container - Inbound $1,790.00
7/1/2007 20' Full Container - Outbound $1,528.00
7/1/2007 40' Full Container - Outbound $7,462.00
7/1/2007 45' Full Container - Outbound $3,580.00
7/1/2007 20' Transhipment Container - Inbound $860.00
7/1/2007 40' Transhipment Container - Inbound $14,040.00
7/1/2007 45' Transhipment Container - Inbound $6,156.00
7/1/2007 20' Transhipment Container - Outbound $2,924.00
7/1/2007 40' Transhipment Container - Outbound $7,540.00
7/1/2007 20' Transhipment Container Inbound $215.00
7/1/2007 40' Transhipment Container Inbound $323.50
7/1/2007 40' Transhipment Container Inbound $323.50
I want Dry Empty how many
I want Full container how many
I want Transhipment how many
Tks U very much for yr help !
Rgds
Tom
/////////////////////////////////