Connecting Tech Pros Worldwide Help | Site Map

Convert Spreadsheet Array to MS Access

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 04:03 AM
Rod MacPherson
Guest
 
Posts: n/a
Default Convert Spreadsheet Array to MS Access

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, 04:03 AM
Douglas J. Steele
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.