Results 1 to 2 of 2

Thread: crosstab option

  1. #1
    Join Date
    Sep 2006

    Unanswered: crosstab option

    how do i do a crosstab query to pull all the valuse together. like so

    Col A Col B
    Blue Apple
    Blue Orange
    Blue Pear
    Red Apple
    Red Pecan

    Blue Apple, Orange, Pear
    Red Apple, Pecan

  2. #2
    Join Date
    Oct 2002
    Baghdad, Iraq
    You're trying to join the Column B values into one string? There's no way to do that (that I know of) in a query in Access using only SQL. Other systems (MySQL) can do it with nonstandard syntax.

    There is a Visual Basic approach. As I don't have Access handy on this machine I can't show you the code, but in short you have a query that looks like this:

    SELECT ColA, ConCatStrings(ColA) FROM YourTable
    The VB approach is not preferred, though.
    Last edited by sco08y; 07-02-07 at 13:16.

Posting Permissions

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