Re: Permutations - 8 columns

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Tom Ogilvy (twogilvy_at_msn.com)
Date: 02/20/05


Date: Sun, 20 Feb 2005 16:26:44 -0500


>We are not allowed to extract the information directly from the database
>in a tabular form.

I suspect if he could query the database, he wouldn't need the combinations.

Sounds like he is blindly querying the database with all possible
combinations to get back any possible results that may exists.

Just my guess of course.

-- 
Regards,
Tom Ogilvy
"Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
news:On92jq4FFHA.2568@TK2MSFTNGP10.phx.gbl...
> Since you're using a database, why not just let SQL do the work ?
>
> select t.Period, t.account, t.currency, t.code, t.country,[other
> columns here], sum(t.amount),average(t.amount)
> from DataTable t
> group by
> t.Period, t.account, t.currency, t.code, t.country,[other column here]
>
> Unless I misunderstand your explanation that should give you the
> desired result.
>
> Tim.
>
>
> <sanshah01@yahoo.com> wrote in message
> news:1108890725.056729.169580@g14g2000cwa.googlegroups.com...
> > Hi,
> >
> > I have gone through various posts in this group for the solution of
> > a
> > permutation I require but could not find one.
> >
> > The data I have is as follows in eight columns
> >
> > Col A   Col B     Col C     Col D   Col E ............ etc
> > Period  Account   Currency  Code    Country ....... etc
> > Nov-04  99700     USD       1234    USA
> > Dec-04  51000               2270    EUR
> >        61000               2568    IND
> >        38000
> >
> > I need to have a macro which would give me a combination of data in
> > various columns into a database format. There can be additions to
> > the
> > information in some of the columns for eg. incase a new account is
> > created.
> >
> > The output on another *** needs to be as follows
> >
> > for eg.
> > Col A   Col B     Col C     Col D   Col E ............ etc
> > Period  Account   Currency  Code    Country ....... etc
> > Nov-04  99700      USD      1234    USA
> > Nov-04  99700      USD      1234    EUR
> > Nov-04  99700      USD      1234    IND
> > Nov-04  99700      USD      2270    USA
> >
> > Let me provide a background on why I am following this process since
> > if
> > someone has a better suggestion for arrive at the end result, I am
> > open
> > for it.
> >
> > We have a database where all the financial information is stored. We
> > are not allowed to extract the information directly from the
> > database
> > in a tabular form. However using Excel retrieve I am allowed to
> > extract
> > the information based on various paramaters and unique variables of
> > each parameter is being listed by me as shown in the first table.
> >
> > After having a permutation of various cols and parameters, I will be
> > adding an amount column which would provide the information
> > retrieved
> > based on the unique combination of 8 columns / 8 parameters.
> >
> > Anyone's help is highly appreciated.
> >
> > Regards
> > Sandip.
> >
>
>

Quantcast