Connecting Tech Pros Worldwide Help | Site Map

Convert Spreadsheet Array to MS Access

  #1  
Old November 13th, 2005, 05:03 AM
Rod MacPherson
Guest
 
Posts: n/a
I frequently have to convert spreadsheet arrays into relational
tables, and was wondering if anyone had a trick for doing so.
Example:

Apr May Jun
Entity 1 10 20 30
Entity 2 15 25 35
Entity 3 18 28 38


Needs to be converted toL

Entity 1, Apr, 10
Entity 1, May, 20
Entity 1, Jun, 30
Entity 2, Apr, 15
Entity 2, May, 25
etc.
etc.
  #2  
Old November 13th, 2005, 05:03 AM
Douglas J. Steele
Guest
 
Posts: n/a

re: Convert Spreadsheet Array to MS Access


When you say "spreadsheet array" are you linking to Excel? If so, you should
be able to write a Union query to give what you want:

Assuming that the fields in the linked Excel table are named Field1, Apr,
May and Jun, your query would be something like:

SELECT Field1, "Apr" As WhatMonth, Apr FROM MyLinkedExcelTable
UNION
SELECT Field1, "May" As WhatMonth, May FROM MyLinkedExcelTable
UNION
SELECT Field1, "Jun" As WhatMonth, Jun FROM MyLinkedExcelTable

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Rod MacPherson" <rod@rodmacpherson.com> wrote in message
news:88d5d17f.0411011301.63a7de79@posting.google.c om...[color=blue]
> I frequently have to convert spreadsheet arrays into relational
> tables, and was wondering if anyone had a trick for doing so.
> Example:
>
> Apr May Jun
> Entity 1 10 20 30
> Entity 2 15 25 35
> Entity 3 18 28 38
>
>
> Needs to be converted toL
>
> Entity 1, Apr, 10
> Entity 1, May, 20
> Entity 1, Jun, 30
> Entity 2, Apr, 15
> Entity 2, May, 25
> etc.
> etc.[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help gunimpi answers 0 January 10th, 2007 08:55 PM
Word 2007 XML document and the w namespace Andy answers 2 December 6th, 2006 09:55 PM