Abdul-
Perhaps like this:
SELECT tblOrders.OrderID,tblOrders.InvoiceNumber, tblOrders.InvoiceDate,
(SELECT Count(OrderID) FROM tblOrders As T2
WHERE T2.InvoiceDate = tblOrders.InvoiceDate) As CountInvoiceThisDate
FROM tblOrders;
You must use a subquery because I assume you want the count of all
invoices issued on the same date as the one in each order. If you simply
want a count of invoices by date, do:
SELECT tblOrders.InvoiceDate, Count(InvoiceNumber) As CountOfInvoices
FROM tblOrders
GROUP BY InvoiceDate;
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Abdul Shakeel <maxccess@gmail.com>
Reply-To: <MS_Access_Professionals@yahoogroups.com>
Date: Thursday, October 25, 2012 1:00 PM
To: <MS_Access_Professionals@yahoogroups.com>
Subject: [MS_AccessPros] Count Invoice Number for the Day
Dear All,
I have following query, I want another column for Number of invoice (count)
for the day.
SELECT tblOrders.OrderID,tblOrders.InvoiceNumber, tblOrders.InvoiceDate
FROM tblOrders;
--
Regards,
Abdul Shakeel
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar