473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SQL (beginners) question. Select distinct(date), customer, cnt(items).....

Hi,

Which msAccess SQL guru can help my out here?
i would like a list of sales(count) per day per customer

end result, something like:
distinct(date), customer, cnt(ItemsSold)
20/5/2005, c1, 10
20/5/2005, c2, 1
20/5/2005, c3, 8
21/5/2005, c1, 5
21/5/2005, c2, 15
etc...

select distinct(format(InspDatTim,"dd/mm/yyyy")) as distinctDate, ...
from sales
....
thanks,
you are my hero...
Nov 13 '05 #1
2 8243
b. hotting wrote:
Hi,

Which msAccess SQL guru can help my out here?
i would like a list of sales(count) per day per customer

end result, something like:
distinct(date), customer, cnt(ItemsSold)
20/5/2005, c1, 10
20/5/2005, c2, 1
20/5/2005, c3, 8
21/5/2005, c1, 5
21/5/2005, c2, 15
etc...

select distinct(format(InspDatTim,"dd/mm/yyyy")) as distinctDate, ...
from sales


SELECT DateField, Customer, Count(ItemsSold)
FROM TableName
GROUP BY DateField, Customer

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
thanks Rick,

it was the
"group by format(DateField,"dd-mm-yyyy"),"
that set me off.
thought i could use the alias

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:wt*****************@newssvr12.news.prodigy.co m...
b. hotting wrote:
Hi,

Which msAccess SQL guru can help my out here?
i would like a list of sales(count) per day per customer

end result, something like:
distinct(date), customer, cnt(ItemsSold)
20/5/2005, c1, 10
20/5/2005, c2, 1
20/5/2005, c3, 8
21/5/2005, c1, 5
21/5/2005, c2, 15
etc...

select distinct(format(DateField,"dd/mm/yyyy")) as distinctDate, ...
from sales


SELECT DateField, Customer, Count(ItemsSold)
FROM TableName
GROUP BY DateField, Customer

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richard P | last post by:
I need some help on timers. My app is asp.net 1.1 website running in a shared hosting environment with a third-party service provider. I currently request and cache 20 - 40 remote RSS feeds. When a...
4
by: David Sworder | last post by:
Hi, I have a ComboBox that contains 1,400 sorted items . Here's the list: abba apple ... cabba caccaa capple
3
by: Pol Bawin | last post by:
Hi All, One : I have a property that get/set a array of an abstract class A By default my array is null In the propertygrid, It is not works correctly when my array is null. (when my array...
6
by: Woody Splawn | last post by:
I have a Winform where I fill a table with an associated dataset. This will put say 20 records into the table. I know this is elemental but... I want to see only one record from on my Winform...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
5
by: Aussie Rules | last post by:
Hi, Having a mental block on this one. Have done it before but can't rack my brain on how... I have an object, with a bunch on property, and I add that object to a combo box. I want the...
5
by: J055 | last post by:
Hi The following code works on my develeopment machine using the VS web server. When I run the application on 2 other Windows 2003/IIS 6 servers no caching seems to take place at all. Can...
8
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I make the 'Menu & Toolbars' menu active in the toolbox? Right now I can see the options, but not been able to select items.
1
by: clreed87 | last post by:
I am trying to develop a sales report coming off our postgresql server and am rumming into some problems. Basically I just want to group by the customer name and view a customers orders and sales...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.