New method of adding unique column to totals query.

F

Frank Martin

I have much trouble in adding a column of sequencing numbers to a totals
query to select a unique record.

Instead of this I have joined two columns into a new one, and in this case I
have used the "CStr" function to convert the date into a text string.

Then I combine two columns such that the result with be a "de facto" primary
key, and in this case I have done the addition:

Expr8: (CStr([AddressesID]))+(CStr(Format([InvoiceDate],"mmmyy"))), which
gives me a unique set of values in a column on which I can base a combo
selection.

Can someone tell me if this is OK, and there will not be time bombs later
on?

Regards, Frank
 
J

JohnFol

Hi Frank, the Totals query is I presume some sort of Group By query, ie

Select SalesPerson, Sum(Sales) from MySalesTable Group By SalesPerson

Frank 20
John 30
Steve 10
and you want each row to have a unique reference ie

1 Frank 20
2 John 30
3 Steve 10

If this is correct, then you don't need the extra column to identify the
row, as the SalesPerson (in this example) will be unique.

If you want a sequential number for display purposes, i.e. on a report just
do a RunningSum.
 
Top