Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Stacked bar chart

Discussion in 'Information Technology' started by Bob, Jul 28, 2006.

Tags:
  1. Bob

    Bob
    Expand Collapse
    Guest

    I am trying to generate a stacked bar chart that will show the number of
    sales and deliveries each month over a year's time.
    My tables include the following fields

    tblInvoice
    (PK) invoice#
    SaleDate
    DeliveryDate
    ...

    tblOrderDetail
    (PK) id
    invoice#
    Style
    ...

    I Think I want to put together a query that will count the number of
    invoices for each style sold each month, and the number of invoices
    delivered each month but each time I try to build the query it comes up with
    a count of 1 for each invoice.

    Would it be better to export this data into Excel and work it from there?

    Thanks
     
  2. Loading...

    Similar Threads Forum Date
    Being Thyar Bar Thyar Vs The Environment Questions and Answers Today at 10:39 AM
    Barkha Joins Sikh Philosophy Network! New SPN'ers Dec 22, 2016
    Sikh Philosophy Network Welcomes InnerDarbar Ji New SPN'ers Aug 16, 2016
    Sikh News Sikh Temple Blown Up By Islamic State Supporters 'Not Terrorism' - Breitbart News Breaking News Jul 21, 2016
    Sukh Santokh Sabar | Contentment As Per Gurbani | Bhai Sarbjit Singh Dhunda Gurmat Vichaar May 24, 2016

  3. OP
    Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi Bob,

    > but each time I try to build the query it comes up with
    > a count of 1 for each invoice.


    It would be helpful if you provided the SQL statement for your query. To
    view your SQL statement, click on View > SQL View in query design. Copy the
    SQL statement (select it & Ctrl C) and then paste into a reply (Ctrl V). Here
    is a SQL statement that might work for you:

    SELECT Month([SaleDate]) AS [Month Sold],
    Count(Month([SaleDate])) AS [Number of Orders], tblOrderDetail.Style
    FROM tblInvoice
    INNER JOIN tblOrderDetail ON tblInvoice.[invoice#] = tblOrderDetail.[invoice#]
    GROUP BY Month([SaleDate]), tblOrderDetail.Style
    ORDER BY Month([SaleDate]), Count(Month([SaleDate]));



    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.html
    http://www.access.qbuilt.com/html/search.html
    __________________________________________

    "Bob" wrote:

    > I am trying to generate a stacked bar chart that will show the number of
    > sales and deliveries each month over a year's time.
    > My tables include the following fields
    >
    > tblInvoice
    > (PK) invoice#
    > SaleDate
    > DeliveryDate
    > ...
    >
    > tblOrderDetail
    > (PK) id
    > invoice#
    > Style
    > ...
    >
    > I Think I want to put together a query that will count the number of
    > invoices for each style sold each month, and the number of invoices
    > delivered each month but each time I try to build the query it comes up with
    > a count of 1 for each invoice.
    >
    > Would it be better to export this data into Excel and work it from there?
    >
    > Thanks
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page