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.
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.