(QRY) I have no idea how to put this into words...

G

Guest

....much less a SQL statement.

A supervisor several levels above my direct supervisor 'asked' me to include
a chart view option in a database interface I developed, with the underlying
query acomplishing the following:

Given that the first field is the calculated month of related date, with all
the records grouped on that month, he wants additional columns, one for each
year that is present within the recordset that he is working with, and
displaying records that sum the total record value for that month and year.
(So he can compare any given set of years against each other.)

I can easily create 1 additional column with the appropriate values, however
I am not comprehending how I can get the additional columns with the
appropriate values.

If this was a fixed data set, I think I could create the dataset easily, as
it stands though, the dataset that he will be working with has 15 different
potential filters (include or exclude, which includes a user selected date
range), and 9 different value sets that can/will be chosen, all of it sent to
visual display through a generated SQL string in code.

At the moment, I am thinking:
Based off of the user defined date range, I run a series of SQL statements,
each one to get the sum values needed for each month for each year, then run
a single SQL statement after that joins each of the other SQL statements
through the Month value.

I may have just answered my own question, but leaving this up here in case
someone of much greater intelligence and wisdom might have a big (or small)
bright light to shine on this.
 
G

Guest

with all the records grouped on that month, he wants additional columns,
one for each yeara single SQL statement after that joins each of the other SQL statements
through the Month value.

The way you stated it is impossible. You want it rolled into a sum for a
month and then display the year.
 
G

Guest

Exactly. I have no idea how to explain this in words, much less make it a
query. I am just unsure if your response is based off of my (likely) faulty
way of explaining it, or if you understand what I am trying to say, and are
saying that it is not possible.

Any clarification?
 
G

Guest

You can not do what I interpreted your words to mean.
That said how about posting table structure (field names and datatype),
sample data, and how you would like out to look.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top