Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 31st, 2005, 12:04 AM
leon_i_ leon_i_ is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 leon_i_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 51 sec
Reputation Power: 0
Lightbulb access SQL count(distinct fieldname)

Hi, m tryin to count distinct serialNumbers for each particular WorkOrder.
I wrote this code and its not workin...i am new to access SQL database programming

SELECT count(distinct SerialNumber), WorkOrder
FROM Results
GROUP BY WorkOrder;

pliz help

Reply With Quote
  #2  
Old July 31st, 2005, 04:42 AM
elijathegold's Avatar
elijathegold elijathegold is offline
Senior Fire Wizard
Click here for more information
 
Join Date: Feb 2005
Location: Ashford, Kent. England
Posts: 5,651 elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1721622 Folding Title: Super Ultimate Folder - Level 4
Time spent in forums: 2 Months 2 Weeks 2 Days 4 h 21 m 19 sec
Reputation Power: 301
Quote:
Originally Posted by leon_i_
Hi, m tryin to count distinct serialNumbers for each particular WorkOrder.
I wrote this code and its not workin...i am new to access SQL database programming

SELECT count(distinct SerialNumber), WorkOrder
FROM Results
GROUP BY WorkOrder;

pliz help


Code:
SELECT WorkOrder, COUNT(SerialNumber) AS c FROM Results GROUP BY WorkOrder
__________________
And he picked it all up... in his pick-up.





Friends of Shemzilla

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > access SQL count(distinct fieldname)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT