Here is a challenge for all you guys !!!! ...for me it is anyhow !!! 
I have a field in a database that contains coding for a WBS... so for example, the following show what i need to query and what the grouping should be....
0000-0000-00000-M.000128.0002.0000
0000-0000-00000-I.000000.0000.0000
So i need to be able to group by the result of a formulas for 4 different scenarios.... from that 1 field.
Scenario #1 -- > 0000-0000-00000-M.000128.0001.0000
where the "M.??????.0001" = Group #1
Scenario #2 -- > 0000-0000-00000-M.000128.0002.0000
where the "M.??????.0002" = Group #2
Scenario #3 -- > 0000-0000-00000-M.000128.0003.0000
where the "M.??????.0003" = Group #3
Scenario #4 -- > 0000-0000-00000-I.000128.0002.0000
where the "I" = Group #4
The question ????? means that it sould be different digits for each records....the constant variable that allow me to "label" that group is the "M" and the 4 last digit of the group as shown...
For group #4, just the "I"
Any help would be greatly appreciated !!!!