T
Travis
I've got a number of nifty queries in Access which I'd like to be able
to view the results of in Excel.
I don't think I can recreate the queries in Excel using MS Query, as
far as I can tell (and please correct me if I'm wrong) you can't do
such things as sum queries and other arithmetic operations.
Is there a way from Excel (some light VBA is ok, but I'm not proficient
yet) to call complex queries from Access, or should I use maketable
queries in Access to make a table with the data which I can then import
into Excel using the simple query builder available in Excel?
And while I'm at it, I'm still stumped by how to construct a query that
will put information from a portfolios table into the format I want.
The raw data in the table looks like this:
Investment1 Owner1 100% 100
Investment1 Owner1 50% 300
Investment1 Owner2 50% 300
Investment2 Owner2 100% 100
Investment2 Owner2 100% 1000
Investment3 Owner3 50% 20
Investment4 Owner4 100% 1
In the above table there are four investments owned in various
proportions by four different owners.
Investment1 has two parcels, the first parcel was bought in the name of
Owner1 and the second bought 50/50 with Owner2, the first parcel is 100
units, the secon parcel is 300 units (owned 50/50, e.g. 300 units owned
by two people. Note that this is not legally the same as owning 150
each as the investment could be a jointly held asset, not tenants in
common.
Investment2 was bought in two parcels, both solely by Owner2, there are
1100 units altogether.
Investment3 was bought in a single parcel, it is half owned by Owner3
and the rest by some outside party that I'm not bothering to track. I
only care that Owner3 has a 50% share in Investment3, bought in a
single transaction. There are 20 units, 50% owned.
Investment4 was bought in a single parcel, 100% of 1 unit by Owner4
The output I would like would be a table formatted this
<name of investment> <total number of units owned> <ownership shares>
Investment1 400 62.5% Owner1 37.5% Owner2
Investment2 1100 100% Owner2
Investment3 20 50% Owner3
Investment4 1 100% Owner4
There are of course other fields involved, like the dollar value of the
units and hence the beneficial $ values owned by each owner, but adding
these won't make the example any clearer to the newsgroup so I'm
omitting them. If I know how to do the above, I'll know how to do the
rest because I imagine its similar.
Any held would be greatly appreciated!
Thanks.
Travis
to view the results of in Excel.
I don't think I can recreate the queries in Excel using MS Query, as
far as I can tell (and please correct me if I'm wrong) you can't do
such things as sum queries and other arithmetic operations.
Is there a way from Excel (some light VBA is ok, but I'm not proficient
yet) to call complex queries from Access, or should I use maketable
queries in Access to make a table with the data which I can then import
into Excel using the simple query builder available in Excel?
And while I'm at it, I'm still stumped by how to construct a query that
will put information from a portfolios table into the format I want.
The raw data in the table looks like this:
Investment1 Owner1 100% 100
Investment1 Owner1 50% 300
Investment1 Owner2 50% 300
Investment2 Owner2 100% 100
Investment2 Owner2 100% 1000
Investment3 Owner3 50% 20
Investment4 Owner4 100% 1
In the above table there are four investments owned in various
proportions by four different owners.
Investment1 has two parcels, the first parcel was bought in the name of
Owner1 and the second bought 50/50 with Owner2, the first parcel is 100
units, the secon parcel is 300 units (owned 50/50, e.g. 300 units owned
by two people. Note that this is not legally the same as owning 150
each as the investment could be a jointly held asset, not tenants in
common.
Investment2 was bought in two parcels, both solely by Owner2, there are
1100 units altogether.
Investment3 was bought in a single parcel, it is half owned by Owner3
and the rest by some outside party that I'm not bothering to track. I
only care that Owner3 has a 50% share in Investment3, bought in a
single transaction. There are 20 units, 50% owned.
Investment4 was bought in a single parcel, 100% of 1 unit by Owner4
The output I would like would be a table formatted this
<name of investment> <total number of units owned> <ownership shares>
Investment1 400 62.5% Owner1 37.5% Owner2
Investment2 1100 100% Owner2
Investment3 20 50% Owner3
Investment4 1 100% Owner4
There are of course other fields involved, like the dollar value of the
units and hence the beneficial $ values owned by each owner, but adding
these won't make the example any clearer to the newsgroup so I'm
omitting them. If I know how to do the above, I'll know how to do the
rest because I imagine its similar.
Any held would be greatly appreciated!
Thanks.
Travis