Assigning a unique value to the output of a dataset

J

Jack

THe following shows sales for last year corresponding to a particular
customer for a particular salesperson


slsman SalesMonth Sum custnum Name
932 1 428030 171042 ABC HLTHCARE DIAG
932 2 369694 171042 ABC HLTHCARE DIAG
932 3 427864 171042 ABC HLTHCARE DIAG
932 4 464207 171042 ABC HLTHCARE DIAG
932 5 444013 171042 ABC HLTHCARE DIAG
932 6 494008 171042 ABC HLTHCARE DIAG
932 7 358036 171042 ABC HLTHCARE DIAG
932 8 234660 171042 ABC HLTHCARE DIAG
932 9 169884 171042 ABC HLTHCARE DIAG
932 10 202184 171042 ABC HLTHCARE DIAG
932 11 141299 171042 ABC HLTHCARE DIAG
932 12 264910 171042 ABC HLTHCARE DIAG

After doing a cross tab query in the above query I get the output of
crosstab as follows
slsman custnum Name GrandTotal Month01 Month02 Month03 Month04 Month05 Month06 Month07 Month08 Month09 Month10 Month11 Month12
932 171042 SIEMENS HLTHCARE
DIAG 3998789 428030 369694 427864 464207 444013 494008 358036 234660 169884 202184 141299 264910

Now i need to assing a unique number 1 to this output. 1 would represent
last years sales.

I am wondering if I need to create a temp table to do this. If there are
simpler approach I would like advise. Thanks.
 
J

John Spencer

Do you want to assign 1 to every record in the output of the query?

Just add a calculated column to the crosstab and assign a value of 1 to
the column.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
J

Jack

Thanks John for the help. I need to add 1 to every record. I just got the
concept while working on it. I appreciate your kind help
Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top