Click here to Skip to main content
15,895,192 members
Home / Discussions / Database
   

Database

 
QuestionAccess AS SQL Front End Pin
mjackson119-Jun-11 5:03
mjackson119-Jun-11 5:03 
AnswerRe: Access AS SQL Front End Pin
Nagy Vilmos9-Jun-11 5:41
professionalNagy Vilmos9-Jun-11 5:41 
AnswerSample Code Pin
David Mujica9-Jun-11 7:56
David Mujica9-Jun-11 7:56 
JokeRe: Sample Code Pin
Mycroft Holmes9-Jun-11 14:17
professionalMycroft Holmes9-Jun-11 14:17 
GeneralRe: Sample Code Pin
mjackson119-Jun-11 18:16
mjackson119-Jun-11 18:16 
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 
Hello,

And thanks in advance for the help.

I am using this query to group exams and count:

SELECT BPG.[GroupName], COUNT(A.[ProcedureID]) AS [Count]
FROM
[DB].[dbo].[Accessions] A
INNER JOIN [DB].[dbo].[table1] BP ON A.[ProcedureID] = BP.[ProcedureID]
INNER JOIN [DB].[dbo].[table2] BPG ON BP.[ProcedureGroup] = BPG.[ProcedureGroupID]
INNER JOIN [DB].[dbo].[table3] O ON A.[OrderID] = O.[OrderID]
INNER JOIN [DB].[dbo].[table4] F ON O.[OrderingFacilityID] = F.[FacilityID]
WHERE
--XRAY,US,PICC,EKG
(BPG.[GroupName] IN ('XRAY','EKG','US','PICC'))
AND
(F.[Name] LIKE '%' + @Facility + '%')
AND
(A.[ExamDate] >= CONVERT(DATETIME, @StartDate + @Year) AND A.[ExamDate] < CONVERT(DATETIME, @EndDate + @Year)
AND
(A.[Status] != 'Cancelled' AND A.[Status] != 'ADMIN CANCEL' AND A.[Status] != 'Cancelled - Dry Run'))
GROUP BY BPG.[GroupName]


Let's say the query only returns 'XRAY' and 'EKG' with a count. How can I also return that 'US' and 'PICC' have zero count. D'Oh! | :doh:

Thanks for the help.
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 
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 

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.