Click here to Skip to main content
15,908,111 members
Home / Discussions / Database
   

Database

 
AnswerRe: Access AS SQL Front End Pin
Mycroft Holmes9-Jun-11 14:22
professionalMycroft Holmes9-Jun-11 14:22 
AnswerRe: Access AS SQL Front End Pin
jschell10-Jun-11 13:06
jschell10-Jun-11 13:06 
QuestionA Grouping Pin
RadioButton9-Jun-11 4:27
RadioButton9-Jun-11 4:27 
AnswerRe: A Grouping Pin
Blue_Boy9-Jun-11 4:42
Blue_Boy9-Jun-11 4:42 
GeneralRe: A Grouping Pin
RadioButton9-Jun-11 4:53
RadioButton9-Jun-11 4:53 
AnswerRe: A Grouping Pin
Chris Meech9-Jun-11 5:26
Chris Meech9-Jun-11 5:26 
GeneralRe: A Grouping Pin
RadioButton9-Jun-11 5:50
RadioButton9-Jun-11 5:50 
AnswerRe: A Grouping Pin
dbrenth9-Jun-11 9:58
dbrenth9-Jun-11 9:58 
Connect to the BPG table and all of its inner joins first.

Then do a LEFT OUTER JOIN to your Accessions (A) table and it's joins.

This will give you all of the group names and the 0's if there is nothing for that group.

SELECT BPG.[GroupName], COUNT(A.[ProcedureID]) AS [Count] 
FROM 
 [DB].[dbo].[table2] BPG
 
  LEFT OUTER JOIN 

 ([DB].[dbo].[Accessions] A 
  INNER JOIN [DB].[dbo].[table1] BP ON A.[ProcedureID] = BP.[ProcedureID]
   INNER JOIN [DB].[dbo].[table3] O ON A.[OrderID] = O.[OrderID]
 INNER JOIN [DB].[dbo].[table4] F ON O.[OrderingFacilityID] = F.[FacilityID]
 
  )

   ON BP.[ProcedureGroup] = BPG.[ProcedureGroupID]
 
  WHERE  
         .....

 GROUP BY BPG.[GroupName]

Brent

QuestionWrite trigger for multiple tables Pin
vishnukamath8-Jun-11 23:45
vishnukamath8-Jun-11 23:45 
AnswerRe: Write trigger for multiple tables Pin
Simon_Whale8-Jun-11 23:51
Simon_Whale8-Jun-11 23:51 
AnswerRe: Write trigger for multiple tables Pin
Chris Meech9-Jun-11 2:13
Chris Meech9-Jun-11 2:13 
QuestionHow to get rows having sum equal to given value Pin
Hum Dum8-Jun-11 21:25
Hum Dum8-Jun-11 21:25 
AnswerRe: How to get rows having sum equal to given value Pin
Blue_Boy8-Jun-11 23:17
Blue_Boy8-Jun-11 23:17 
AnswerRe: How to get rows having sum equal to given value Pin
Jagz W9-Jun-11 0:01
professionalJagz W9-Jun-11 0:01 
AnswerRe: How to get rows having sum equal to given value Pin
Simon_Whale9-Jun-11 0:29
Simon_Whale9-Jun-11 0:29 
GeneralRe: How to get rows having sum equal to given value Pin
Hum Dum9-Jun-11 13:29
Hum Dum9-Jun-11 13:29 
AnswerRe: How to get rows having sum equal to given value Pin
Shameel9-Jun-11 1:02
professionalShameel9-Jun-11 1:02 
AnswerRe: How to get rows having sum equal to given value Pin
Luc Pattyn9-Jun-11 2:11
sitebuilderLuc Pattyn9-Jun-11 2:11 
GeneralRe: How to get rows having sum equal to given value Pin
konduc9-Jun-11 3:16
konduc9-Jun-11 3:16 
GeneralRe: How to get rows having sum equal to given value Pin
Luc Pattyn9-Jun-11 3:34
sitebuilderLuc Pattyn9-Jun-11 3:34 
GeneralRe: How to get rows having sum equal to given value Pin
Hum Dum9-Jun-11 13:27
Hum Dum9-Jun-11 13:27 
AnswerRe: How to get rows having sum equal to given value Pin
Luc Pattyn9-Jun-11 13:33
sitebuilderLuc Pattyn9-Jun-11 13:33 
QuestionConvert MSSQL database to MySQL database Pin
sarang_k8-Jun-11 17:59
sarang_k8-Jun-11 17:59 
AnswerRe: Convert MSSQL database to MySQL database Pin
David Skelly8-Jun-11 22:36
David Skelly8-Jun-11 22:36 
AnswerRe: Convert MSSQL database to MySQL database Pin
Shameel9-Jun-11 1:04
professionalShameel9-Jun-11 1:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.