Months query

  • Thread starter peljo via AccessMonster.com
  • Start date
P

peljo via AccessMonster.com

On the basis of my query i have built a totals query as follows:
SELECT Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice, qryMargin.
invoicedate
FROM qryMargin
GROUP BY qryMargin.invoicedate;

I want to break down the sum so obtained into months on the basis of the
invoicedateand also to arrange them to be not in
alphabetical order but following the order of the months, e.g. january,
february,march etc
Can you help me ?
 
R

Rick Brandt

peljo via AccessMonster.com said:
On the basis of my query i have built a totals query as follows:
SELECT Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice, qryMargin.
invoicedate
FROM qryMargin
GROUP BY qryMargin.invoicedate;

I want to break down the sum so obtained into months on the basis of the
invoicedateand also to arrange them to be not in
alphabetical order but following the order of the months, e.g. january,
february,march etc
Can you help me ?

SELECT
Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice,
qryMargin,
Format(invoicedate,"yyyymm") As SortMonth,
Format(invoicedate, "mmmm, yyyy") as InvoiceMonth
FROM qryMargin
GROUP BY
Format(invoicedate,"yyyymm"),
Format(invoicedate, "mmmm, yyyy")
ORDER BY Format(invoicedate, "yyyymm")

The above assumes you need to span multiple years. If not then the "y"s can be
removed.
 
P

peljo via AccessMonster.com

Thnk you so much !!!
Rick said:
On the basis of my query i have built a totals query as follows:
SELECT Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice, qryMargin.
[quoted text clipped - 7 lines]
february,march etc
Can you help me ?

SELECT
Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice,
qryMargin,
Format(invoicedate,"yyyymm") As SortMonth,
Format(invoicedate, "mmmm, yyyy") as InvoiceMonth
FROM qryMargin
GROUP BY
Format(invoicedate,"yyyymm"),
Format(invoicedate, "mmmm, yyyy")
ORDER BY Format(invoicedate, "yyyymm")

The above assumes you need to span multiple years. If not then the "y"s can be
removed.
 
P

peljo via AccessMonster.com

Thnk you so much !!!
Rick said:
On the basis of my query i have built a totals query as follows:
SELECT Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice, qryMargin.
[quoted text clipped - 7 lines]
february,march etc
Can you help me ?

SELECT
Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice,
qryMargin,
Format(invoicedate,"yyyymm") As SortMonth,
Format(invoicedate, "mmmm, yyyy") as InvoiceMonth
FROM qryMargin
GROUP BY
Format(invoicedate,"yyyymm"),
Format(invoicedate, "mmmm, yyyy")
ORDER BY Format(invoicedate, "yyyymm")

The above assumes you need to span multiple years. If not then the "y"s can be
removed.
 
P

peljo via AccessMonster.com

Thnk you so much !!!
Rick said:
On the basis of my query i have built a totals query as follows:
SELECT Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice, qryMargin.
[quoted text clipped - 7 lines]
february,march etc
Can you help me ?

SELECT
Sum(qryMargin.MarginInvoice) AS SumOfMarginInvoice,
qryMargin,
Format(invoicedate,"yyyymm") As SortMonth,
Format(invoicedate, "mmmm, yyyy") as InvoiceMonth
FROM qryMargin
GROUP BY
Format(invoicedate,"yyyymm"),
Format(invoicedate, "mmmm, yyyy")
ORDER BY Format(invoicedate, "yyyymm")

The above assumes you need to span multiple years. If not then the "y"s can be
removed.
 

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

Top