D
DKMortensen
I am having trouble modifying a report in accordance with the
requirements recently required by a customer.
To make matters worse, all of the Access databases we've done for our
clients have been done by another employee in our company, who started
a new job 3 weeks ago. Now I am following in his "Access footsteps". I
have C++ programming experience, as well as have done a lot with web
sites, linux scripting & some basic database design. So, other than a
learning curve, I think that I should be able to continue to maintain
his creations as needed by our clients. However, this first request
seems to have me a little perplexed. Help would be GREATLY
appreciated ;-)
The problem is as follows:
There is a report that the customer can view, which shows expenses,
grouped by day. Each line is one day, with a column for each expense
'type', and then the last column gives the total for the expenses of
that day. That works fine.
The problem is that the customer also wants a column before the end,
which give's each day's net profit. This it not really a problem
either. It also works fine.
The last line contains monthly totals for each column (expense type).
This is where things "mostly" work, but are not exactly what is
needed.
Everything I have mentioned was created by my past co-worker in the
initial incarnation of this database. The customer recently called me
and said that the report was only including days where an expense was
entered. This is fine for the majority of data in the report, however,
was a problem with the "Net Profit" column. This is because most every
day, the business generates a net profit (either positive or
negative). Not including data from the days where no expenses were
incurred causes the net profit for the days with no expenses to be
omitted. Nothing gets displayed for those days. There is not even a
line in the report for those days. In addition to the problem of this
data not showing up for those days, a second problem that this creates
is that the final line of the report, which contains totals for each
day, displays an the wrong number for the "Net Profit". This is
because it is only including the values for those lines which are
displayed above it in the report.
This is where our client has the problem. This is also where I've been
struggling to come up with the correct method to accomplish what is
needed.
What the client needs is a line for EVERY day of the month to appear
on the report, regardless of whether any data exists in the database
tables for that day. If no data exists, then no numbers need printed.
We don't needs zeros in the fields to know that there were no such
expenses those days. We know that a blank value (nothing) means zero.
Looking further at the current design, and how to accomplish this,
I've found that the report is getting its data from 1 query. As I've
looked at that query, it is actually a cross-tab query, getting all of
its data EXCEPT for the net profit, from one table. The expense table.
For each day in the current working month that expenses exist (in the
expense table), the query returns a line which gives a sum of the
expenses for that day, broken down by category (again, each category
is represented by a column). One of the last columns however is the
net profit column, which actually pulls its value from a separate
table. Its 'Field' field has the value:
Net Income: DLookUp("GrossProfit","UnsecuredLoansQuery","ULDate=#" &
[ExpenseDate] & "#")-[Total Of ExpenseCost]
ExpenseCost is one of the columns/values in each line of our the cross-
tab query.
I've had various ideas as to how to make it display a line for every
month, and experimented with some of them, but to no avail. I think
the bottom line is that we need to have the first field of the query
(which is the ExpenseDate, from the Expenses table), get its data from
somewhere other than the Expenses table, since it is not a reliable
source of returning EVERY day of the month.
I appreciate any help/ideas VERY much, and would be willing to provide
some type of compensation to someone who was able to produce the
desired result for me. Our customer has asked us to deliver this new
report by 5/31/07, which give us about 6 days now.
Again, thanks in advance for your help!!
Sincerely,
-
Doug Mortensen
impala Networks
www.impalanetworks.com
requirements recently required by a customer.
To make matters worse, all of the Access databases we've done for our
clients have been done by another employee in our company, who started
a new job 3 weeks ago. Now I am following in his "Access footsteps". I
have C++ programming experience, as well as have done a lot with web
sites, linux scripting & some basic database design. So, other than a
learning curve, I think that I should be able to continue to maintain
his creations as needed by our clients. However, this first request
seems to have me a little perplexed. Help would be GREATLY
appreciated ;-)
The problem is as follows:
There is a report that the customer can view, which shows expenses,
grouped by day. Each line is one day, with a column for each expense
'type', and then the last column gives the total for the expenses of
that day. That works fine.
The problem is that the customer also wants a column before the end,
which give's each day's net profit. This it not really a problem
either. It also works fine.
The last line contains monthly totals for each column (expense type).
This is where things "mostly" work, but are not exactly what is
needed.
Everything I have mentioned was created by my past co-worker in the
initial incarnation of this database. The customer recently called me
and said that the report was only including days where an expense was
entered. This is fine for the majority of data in the report, however,
was a problem with the "Net Profit" column. This is because most every
day, the business generates a net profit (either positive or
negative). Not including data from the days where no expenses were
incurred causes the net profit for the days with no expenses to be
omitted. Nothing gets displayed for those days. There is not even a
line in the report for those days. In addition to the problem of this
data not showing up for those days, a second problem that this creates
is that the final line of the report, which contains totals for each
day, displays an the wrong number for the "Net Profit". This is
because it is only including the values for those lines which are
displayed above it in the report.
This is where our client has the problem. This is also where I've been
struggling to come up with the correct method to accomplish what is
needed.
What the client needs is a line for EVERY day of the month to appear
on the report, regardless of whether any data exists in the database
tables for that day. If no data exists, then no numbers need printed.
We don't needs zeros in the fields to know that there were no such
expenses those days. We know that a blank value (nothing) means zero.
Looking further at the current design, and how to accomplish this,
I've found that the report is getting its data from 1 query. As I've
looked at that query, it is actually a cross-tab query, getting all of
its data EXCEPT for the net profit, from one table. The expense table.
For each day in the current working month that expenses exist (in the
expense table), the query returns a line which gives a sum of the
expenses for that day, broken down by category (again, each category
is represented by a column). One of the last columns however is the
net profit column, which actually pulls its value from a separate
table. Its 'Field' field has the value:
Net Income: DLookUp("GrossProfit","UnsecuredLoansQuery","ULDate=#" &
[ExpenseDate] & "#")-[Total Of ExpenseCost]
ExpenseCost is one of the columns/values in each line of our the cross-
tab query.
I've had various ideas as to how to make it display a line for every
month, and experimented with some of them, but to no avail. I think
the bottom line is that we need to have the first field of the query
(which is the ExpenseDate, from the Expenses table), get its data from
somewhere other than the Expenses table, since it is not a reliable
source of returning EVERY day of the month.
I appreciate any help/ideas VERY much, and would be willing to provide
some type of compensation to someone who was able to produce the
desired result for me. Our customer has asked us to deliver this new
report by 5/31/07, which give us about 6 days now.
Again, thanks in advance for your help!!
Sincerely,
-
Doug Mortensen
impala Networks
www.impalanetworks.com