A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SQL query construction



 
 
Thread Tools Display Modes
  #1  
Old October 28th, 2008, 06:18 AM posted to microsoft.public.access
blake7
external usenet poster
 
Posts: 153
Default SQL query construction

Hi, I have a table as below and I want to create a query to count the fault
type against the product, I have shown below how i want the query to return
the findings etc, can anyone help. Thanks in advance

PRODUCT FAULTY TYPE
iron customer complaint
television ok
telephone warranty
iron internal issue
iron health & safety
iron ok
iron warranty
iron ok
iron internal issue

what I want
PRODUCT FAULT TYTPE TOTAL
iron customer complaint 1
ok 2
internal issue 2
warranty 1
health & safety 1

  #2  
Old October 28th, 2008, 01:24 PM posted to microsoft.public.access
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default SQL query construction

Based on your description, it looks a little like you could use a totals
query, grouping on the "type" and counting the records. Check Access HELP
for "totals query".

By the way, none of your example records are simply "ok", so how are you
getting "ok 2"?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"blake7" wrote in message
...
Hi, I have a table as below and I want to create a query to count the

fault
type against the product, I have shown below how i want the query to

return
the findings etc, can anyone help. Thanks in advance

PRODUCT FAULTY TYPE
iron customer complaint
television ok
telephone warranty
iron internal issue
iron health & safety
iron ok
iron warranty
iron ok
iron internal issue

what I want
PRODUCT FAULT TYTPE TOTAL
iron customer complaint 1
ok 2
internal issue 2
warranty 1
health & safety 1


  #3  
Old October 28th, 2008, 02:52 PM posted to microsoft.public.access
blake7
external usenet poster
 
Posts: 153
Default SQL query construction

Hi Jeff, thnaks for the reply
I think the way the table info looks when you post it in here changes, below
i have done it again, there are two instances were 2 x "ok" appear in the
fault column against "iron", would you be able to steer me with a little more
info on how to assemble the query ? Thanks Tony

PRODUCT FAULT TYPE
iron customer complaint
television ok
telephone warranty
iron internal issue
iron health & safety
iron ok
iron warranty
iron ok
iron internal issue


what I want

PRODUCT FAULT TYPE TOTAL
iron customer complaint 1
ok 2
internal issue 2
warranty 1
health & safety 1

"Jeff Boyce" wrote:

Based on your description, it looks a little like you could use a totals
query, grouping on the "type" and counting the records. Check Access HELP
for "totals query".

By the way, none of your example records are simply "ok", so how are you
getting "ok 2"?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"blake7" wrote in message
...
Hi, I have a table as below and I want to create a query to count the

fault
type against the product, I have shown below how i want the query to

return
the findings etc, can anyone help. Thanks in advance

PRODUCT FAULTY TYPE
iron customer complaint
television ok
telephone warranty
iron internal issue
iron health & safety
iron ok
iron warranty
iron ok
iron internal issue

what I want
PRODUCT FAULT TYTPE TOTAL
iron customer complaint 1
ok 2
internal issue 2
warranty 1
health & safety 1



 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.