Re: Sum of numbers
- From: "Evi" <evwool@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 05 Mar 2008 06:48:48 GMT
You'll remember that much of your difficulty started because you weren't
allowed to re-design the database but had to work with it, as it is.
I suspect your chap will use a Make Table query at some point.
Oh to be a fly on the wall!
Evi
"ftwguy" <ftwguy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:33AE058C-F73E-4BE2-9295-8178D48DAFAA@xxxxxxxxxxxxxxxx
Well I caved in with regret as I hate being defeated. I guess I take ittoo
personal that I failed. I did speak with the DB designer today, gave himan
overview of all the problems. He did say the Union All query would notfix
my report problem, but some 'scripting" would do it. I did explain thehuge
tables to him and he agreed that it all needs to be redone, and knewexactly
the problems I am encountering. He said he could even write me a programto
automatically inmport sales data from Excel into the Access tables, andhit
every cell with the correct data, and ignore the ones that dont need data.I'll
Now that I will be amazed by.
Don't know his fee yet. That's something between he and the boss, but
hear what it is. I just warned the boss not to be too low in the contractis
price and offend the guy with that much experience, education and
certifications.
"Evi" wrote:
You have all my sympathy. I wonder if you'll find out how much this chap
flaggoing to get paid to fix the db :)
Evi
"ftwguy" <ftwguy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1CE7E509-4C1D-4314-B220-BDC289F56F07@xxxxxxxxxxxxxxxx
Evi:
I truly appreciate all your due diligence. Today I waved the "white
Databaseof
surrender" and simply told the boss that this problem is above myknowledge
and experience to fix. He is going to call a local MS Certified
April.Administrator to come in to insure we have this critical report by
reportI
hope this person agrees. I've seen this person's resume' and veryexpecting
impressive.
I believe this gentleman will see how horrible this database is, and
possibly talk them into a complete redesign as a functional relational
database.
"Evi" wrote:
I really can't picture the results you are talking about. Are you
the fields in the query to be laid out as they would be in your
firstwhile
you click Autoreport to produce the results?
You say the union query 'only shows fields from the first table'.
I presume you mean that it shows the fiield *names* used in the
whatevertable.
totallyIt will show the *data* from all the tables. Field names ought to be
irrelevant. The labels in your reports can be changed to say
(growingyou
like.
Are you saying that the field names are themselves the data?
therehorror). If yes, (and you certainly did not make that clear) then
datais
personno hope for your report and the person who ought to be fired is the
who first designed it.
You say that you wanted your Fields to be *across the top* with the
namesunderneath.
When you say 'fields', do you actually mean data and vice versa?
A field would be Customer Name. Data would be Bill Smith.
Do you mean that you want a multicolumn report with all customers'
underneathlisted across the top of the page and the products they buy
theeach
multicolumnname?
If yes, then you need to think about turning your report into a
report, grouped by customer name.
If you mean that you want a list of products down the left side of
totalsreport and a list of customers across the top of the page and say
according toof
querywhat they spent in the middle, then you will have to turn your union
into a Crosstab query.
To 'merge the customers', you will group them in the report
bought.customercustomerID using the Sorting/Grouping box and choosing to have a
Header/Footer.Put all the controls/fields about the customer himself
(name/ID/address etc) in the Group Header) so that you will have a
heading and under that name & ID the products which that custome
Product'sOr
you can take the same query and group a second report by the
theunique field so that the Product details are in the Group Header and
wantthat.customers who bought the product are listed in a downward list below
Please clarify what you want.
You may have to break newsgroup law and type a sample of what you
ones.to
see, translating any confusing words into things easily understood
me(If
you don't use Rich Text, then your layout will be lost).
Evi
"ftwguy" <ftwguy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5D36F724-B432-4D1C-B445-43E859B43A3C@xxxxxxxxxxxxxxxx
Evi:
I wrote the SQL for the UNION ALL, but not sure how it will help
wouldtable ingenerate
my report. The Union Query only shows FIELDS from the very first
fallsthe SQL statement. The remaining data from the other tables just
table 1under
those...so, the 8th field of table 3 falls under the 8th field of
knowetc. I dont see how I can use it that way. My report would never
what
to look for.
I was HOPING all my fields would be across the top, and the data
inHOU6534fall
under it according to product, customer etc and the customer wouldbasically
be unioned, merged together based on those IDs I wrote about like
in
a row and all their product quanties nicely laid out left to right
insertthe
table under the proper product name, quantity etc so I could
forina
report.
Oh now sure if I'll get a bonus for figuring this out or get fired
itsnot
being able to generate this critical sales report.
"Evi" wrote:
Well, well, I've learnt something else new, Rob. So that's how
querydone!
And ftwguy, don't worry about the lack of linking. The union
Unionworks
fine on unlinked tables and queries so long as they follow the
one,databaseRules.
In fact, you may be better off keeping them unlinked with the
'structure' which you have inherited.
If by any chance, the extra field in the 9th table is a number
dummywhich
you need to calculate, then you could avoid Nulls by adding a
0field to
the queries based on the other tables
In your query grid type
Dummy:0
Now those queries will have a ninth field which says 0 in it.
Similarly, if it's a Yes/No field, then your dummy field can say
the(if
you
want it to say No) or -1 if you want it to say Yes)
Don't forget, your union query will not be based directly on
queriestables
but
on the queries which are based on the tables (or even on the
one,which
are based on the queries which are based on the tables.
Your boss had better give you a big fat bonus if you solve this
inftwguy - talk about making bricks without straw!
Evi
"Rob Parker" <NOSPAMrobpparker@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote
clause,Null,message
news:OicaIczeIHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
You just add the additional field as a constant entry, set to
Unionfor
the
tables with 8 fields.
If you use your third table in the first SELECT clause of your
somethingquery,
you won't need to define an alias for this field; you'll have
like:
SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9
FROM Table3
UNION
SELECT F1, F2, F3, F4, F5, F6, F7, F8, Null
FROM Table1
UNION ...
If you have one of the 8-field tables in the first SELECT
finalyou
clause;just
alias the Null entry to the 9th fieldname in the first SELECT
you'll
have something like:
SELECT F1, F2, F3, F4, F5, F6, F7, F8, Null As F9
FROM Table1
UNION
SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9
FROM Table3
UNION ...
Note that UNION will eliminate duplicate records from the
UNIONresult.
If
you have duplicates and need to retain them, you must use
theALL
tables,
HTH,
Rob
"ftwguy" <ftwguy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:38A0E2BA-F1DA-4E58-B91A-823309228C95@xxxxxxxxxxxxxxxx
Evi...I thought I could build the queries from the linked
but
then
realized I have to do them in each database then import to
becausemain
database.
I got underway today through the 3rd table and stopped
thethat
table
has 9 fields while the first 2 have only 8. I have to use
the9th
field
because the product comes in 2 sizes. How do I account for
Query9th
numberfield
in
the tables that have 8. Your notes say I must have the same
of
fields.
"Evi" wrote:
The secret to making it error free, is to make the Union
querieswith
queries
where the filtering/calculations have been done on the
inon
which
your
final queries are based so that all you have to do is type
Remember,the
field
names and query names, following the 'recipe' below.
Report. Soyou
won't
need to sort your queries - that will be done in the
Insertif
you
want
to filter your list, filter it in one query then go to
needQuery
and
Eventually,put
all the fields from your filtered query into a new query.
you'll be able to do it the cleverpants way and will not
aall
those
superfluous queries but for now, try it this way..
I found it really unnerving doing a query that didn't have
actionDesign
View -
I thought it would blow up or something if I got it wrong.
If it helps, I can send you a simple example of one in
messageso
that
you
can take it to bits and see its innards.
Tell us if you get it to work, eh?
Evi
"ftwguy" <ftwguy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
levelyesterdaynews:E5DDC71C-0D21-48E3-B6F2-37F123CC5FC8@xxxxxxxxxxxxxxxx
Evi...I will try the Union query again today. I tried
for
hours
and kept getting errors. It may be above my experience
in
Sorting/GroupingmisunderstoodAccess.
"Evi" wrote:
A union query may be able to do this, unless I have
Doyou.
try it. In the report itself, you then use the
ForceNewPagebox
groupto
the resulting report by customer ID and use the
Property
.
- References:
- Re: Sum of numbers
- From: ftwguy
- Re: Sum of numbers
- From: Rob Parker
- Re: Sum of numbers
- From: Evi
- Re: Sum of numbers
- From: ftwguy
- Re: Sum of numbers
- From: Evi
- Re: Sum of numbers
- From: ftwguy
- Re: Sum of numbers
- From: Evi
- Re: Sum of numbers
- From: ftwguy
- Re: Sum of numbers
- Prev by Date: Re: Formatting date fields
- Next by Date: Re: hide certain records on a report
- Previous by thread: Re: Sum of numbers
- Next by thread: Bold report column based on month
- Index(es):
Relevant Pages
|