|
|
How to make multiple values show up
I have a table that has the fields SpeciesID and Frequency (both Long
Integer). Example Data:
SpeciesID Frequency
1 3
2 1
3 4
I would like somehow to see the resulting data:
SpeciesID
1
1
1
2
3
3
3
3
In other words, have SpeciesID represented in the data set as many times as
it has frequency in the original table.
Any ideas?
|
|
0
|
|
|
|
Reply
|
Utf
|
3/1/2010 5:19:01 AM |
|
On Sun, 28 Feb 2010 21:19:01 -0800, Clddleopard
<Clddleopard@discussions.microsoft.com> wrote:
>I have a table that has the fields SpeciesID and Frequency (both Long
>Integer). Example Data:
>SpeciesID Frequency
>1 3
>2 1
>3 4
>
>I would like somehow to see the resulting data:
>SpeciesID
>1
>1
>1
>2
>3
>3
>3
>3
>
>In other words, have SpeciesID represented in the data set as many times as
>it has frequency in the original table.
>
>Any ideas?
You can do this with the help of a little auxiliary table. I'll usually add a
table named Num, with one Long Integer field N, filled with values from 0
through 10000 or so (use Excel... Insert... Series and copy and paste is a
quick way to fill it).
A query
SELECT SpeciesID
FROM yourtable INNER JOIN Num
ON Num.N < yourtable.Frequency
will give you the result you describe.
--
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
3/1/2010 5:28:06 AM
|
|
Thanks John, that worked great, though I did end up having to write it as
SELECT SpeciesID
FROM yourtable INNER JOIN Num
ON Num.N < =yourtable.Frequency
to get the correct result.
Thanks again!
"John W. Vinson" wrote:
> On Sun, 28 Feb 2010 21:19:01 -0800, Clddleopard
> <Clddleopard@discussions.microsoft.com> wrote:
>
> >I have a table that has the fields SpeciesID and Frequency (both Long
> >Integer). Example Data:
> >SpeciesID Frequency
> >1 3
> >2 1
> >3 4
> >
> >I would like somehow to see the resulting data:
> >SpeciesID
> >1
> >1
> >1
> >2
> >3
> >3
> >3
> >3
> >
> >In other words, have SpeciesID represented in the data set as many times as
> >it has frequency in the original table.
> >
> >Any ideas?
>
> You can do this with the help of a little auxiliary table. I'll usually add a
> table named Num, with one Long Integer field N, filled with values from 0
> through 10000 or so (use Excel... Insert... Series and copy and paste is a
> quick way to fill it).
>
> A query
>
> SELECT SpeciesID
> FROM yourtable INNER JOIN Num
> ON Num.N < yourtable.Frequency
>
> will give you the result you describe.
> --
>
> John W. Vinson [MVP]
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
3/1/2010 2:14:01 PM
|
|
|
2 Replies
318 Views
(page loaded in 1.679 seconds)
Similiar Articles: Query with parameters set to a List Box displaying multiple values ...I'm trying to set up a query with parameters set to a list box holding multiple values... I have set a query with its parameters displaying single val... Multiple values in a crosstab - microsoft.public.access.queries ...I have database where each emloyee enters date and hours worked, I then calculate hours by rate to give value. I need a crosstab to show by emloyee(... how to sum values in multiple fields and put in another ...I want a field in my table to show the total held (e.g. 21). I can do this ... how to sum values in multiple fields and put in another ... I have created a simple asset ... how to make grand total to show up on pivotchart? - microsoft ...Hello, I have created a pivot table, overall it look like this: ----- Location Code | (Multiple Items)... enter multiple criteria via text box - microsoft.public.access ...I have set up the criteria field for the UnitCode ... Field UnitCode Sorting Show ... Query using multiple values from one text box - microsoft.public ... Summing up multiple line items per invoice number (RefNumber ...Find number of times certain words show up in a ... How to create Multiple Invoices with Multiple Line Items ... items (I ... half, seems like it would sum up values ... Plotting multiple y values for the same x value in a scatter graph ...Plotting multiple y values for the same x value in a scatter graph ... If there is ... but with the same x value. ... use the Scatter or ... allow show multiple Y values in ... How can I create a multiple field search box? (corrected post ...How do I query multiple data values in same field? - microsoft ... How can I create a multiple ... box, so that I can search ... show multiple rows. It is very easy to create ... Fill Multiple Fields - microsoft.public.access.formsHowever, when I do, I would like to enter the same value ... however, I > cannot figure out how to make each field show up on the form - if they select ... Fill Multiple ... How do you set up backround with multiple pictures? - microsoft ...I need to set up backround with multiple pictures because I have ... screens and I can type the desired values on ... microsoft.public.excel Hi, How do you make a picture show up ... Excel - How To Make Multiple Name Show Up Only Once In Pivot Table ...How To Make Multiple Name Show Up Only Once In Pivot Table? - In the attached file xlsx under ... of which there are 25, "Type" of which there are 2, and a numeric value ... Store multiple values in a lookup field - Access - Office.comYou can create a lookup field that stores multiple values per record. ... displays the set of looked-up values in ... Show Only Row Source Values: Show only values ... Use a list that stores multiple values - Access - Office.comYou can select up to 100 items by selecting the check boxes. The new ... A check box drop-down list is a combo box control set to support multiple values. These figures show a ... How to: Create a Multiple-Column LookupIn SharePoint Foundation 2010, you can create a multiple ... and one or more secondary lookup columns show values ... lookup column named Customer ID that looks up the value ... How do I... Display multiple values in an Access value list ...Susan Sales Harkins shows you how it works. The title’s a mouthful, but don’t get too hung up on the ... Populating multiple columns in a value list control is ... 7/15/2012 12:41:59 PM
|
|
|
|
|
|
|
|
|