Months query

  • Thread starter Thread starter peljo via AccessMonster.com
  • Start date 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 ?
 
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.
 
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.
 
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.
 
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.
 
Back
Top