Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2012
    Posts
    54

    Unanswered: creating a pivot table with vba

    hi guys!!
    I'm working on a strange issue:
    the fact is:
    I've a table called xlstable3 that is done like this:

    Code:
    CDPRD    ......OTHESFILEDS
    PCA
    PCA
    PCA
    PCB
    PCB
    PCB
    PCD
    PCD
    I'd just like to have a new table(called piv2) which stores the fields data like this:
    Code:
    CDPRD   N
    PCA       3
    PCB       3
    PCD       2
    The code I've tryed to solve the problem is:
    Code:
    Sub ilv()
    Const c = "INSERT INTO piv2  SELECT CDPRD Distinct COUNT(CDPRD) As N FROM xlstab3 GROUP BY CDPRD"
    CurrentDb.Execute (c)
    End Sub
    The code error is 3075, missing operator!
    if you are in need of more details feel free to ask!
    thank you all in advance!!!
    Last edited by jsirico; 02-28-12 at 12:49.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •