>OK - here's the situation:
>
>I have a table with a field, dealnumber, that could contain the following values (as examples):
>
>ATP-SP
>ATP-SP2
>ATP-SP19
>BP-SP
>BP-SP2
>BP-SP19
>
>I would like to select and group the data by the portion of the deal number that goes up to "SP" (i.e. ATP-SP, BP-SP). I initially attacked this by using LEFT() and AT() as follows:
>
>
>SELECT LEFT(DealNumber, AT("-SP", DealNumber)+2) AS TrimmedDeal
>
>
Try wrapping LEFT() in PADR() so you don't have issues based on the first record in the list.
Tamar