Sunday 15 March 2015

Summing the number of multiples in a column in access -


I am trying to access a macro (or query) that will add the number of duplicate values ​​in a column , And to keep those values ​​in a new table, along with the number of duplicates next to it.

For example, I have an unmodified column with 10 values, 6 are "option 1", 3 "option 2" and 1 is "option 3".

  Option 1 Option 2 Option 3 Option 1 Option 1 Option 2 Option 1 Option 2 Option 1 Option 1   

In a 3 x 2 table of that I would like to be able to parse:

  option 1. 6 Option 2 | 3 Option 3 | 1   

In this situation, the data is unreserved, but I can guess that ordered the data in the query. I want to do it in several columns. Is there a way to do this program to use Visual Basic Editor in the program?

I will query a query as if you have defined source and target tables:

  Select Tablet in Target OptionCol, OptionCol (0) by SourceTbl Group from COUNT (*)   

If you only want to put a duplicate (I do a lot of access to it), Add HAVING section:

  INSERT in TargetTbl SELECT OptionCol, COUNT (*) Optional Coal Housing by Group from Source (1)> (*)> 1    

No comments:

Post a Comment