Click here to Skip to main content
16,000,304 members
Home / Discussions / Database
   

Database

 
AnswerRe: Suggestion is needed in sql server 2000 Database Pin
Mycroft Holmes20-Aug-08 18:59
professionalMycroft Holmes20-Aug-08 18:59 
AnswerRe: Suggestion is needed in sql server 2000 Database [modified] Pin
Blue_Boy20-Aug-08 21:18
Blue_Boy20-Aug-08 21:18 
AnswerSQL Server Profiler Pin
David Mujica21-Aug-08 4:56
David Mujica21-Aug-08 4:56 
AnswerRe: Suggestion is needed in sql server 2000 Database Pin
shubhi25-Aug-08 23:48
shubhi25-Aug-08 23:48 
QuestionT-SQL Help [modified] Pin
Hulicat20-Aug-08 7:47
Hulicat20-Aug-08 7:47 
AnswerRe: T-SQL Help Pin
Blue_Boy20-Aug-08 8:21
Blue_Boy20-Aug-08 8:21 
GeneralRe: T-SQL Help Pin
Hulicat20-Aug-08 9:24
Hulicat20-Aug-08 9:24 
AnswerRe: T-SQL Help Pin
TheFM23420-Aug-08 11:59
TheFM23420-Aug-08 11:59 
If your queries return the correct data by themselves, then you should be able to join on a subquerys:

Select
total.Cient
,TotalTicketsAssigned
,TotalClosedForRange
From
(
select count(*) as 'TotalTicketsAssigned' , location_name 'Cient'
from job_ticket j
inner join priority_type p on p.priority_type_id = j.priority_type_id
inner join tech t on t.client_id = j.assigned_tech_id
inner join location l on l.location_id = j.location_id
WHERE Report_Date >= DATEADD(dd,-7,CONVERT(DATETIME,CONVERT(CHAR(8),
GETDATE(),112))) AND
Report_Date < DATEADD(dd,1,CONVERT(DATETIME,CONVERT(CHAR(8),
GETDATE(),112)))
group by l.location_name
) total
Left Join
(
select count(*) as 'TotalClosedforRange'
, location_name 'Cient'
from job_ticket j
inner join priority_type p on p.priority_type_id = j.priority_type_id
inner join tech t on t.client_id = j.assigned_tech_id
inner join location l on l.location_id = j.location_id
where (last_status_update_time >= DATEADD(dd,-7,CONVERT(DATETIME,CONVERT(CHAR(8),
GETDATE(),112))) AND
Report_Date < DATEADD(dd,1,CONVERT(DATETIME,CONVERT(CHAR(8),
GETDATE(),112))) ) and
status_type_id ='3'
group by l.location_name
) Closed on 
total.Cient = closed.Cient

GeneralRe: T-SQL Help Pin
Hulicat20-Aug-08 12:52
Hulicat20-Aug-08 12:52 
GeneralRe: T-SQL Help Pin
TheFM23420-Aug-08 16:01
TheFM23420-Aug-08 16:01 
GeneralRe: T-SQL Help Pin
Hulicat20-Aug-08 16:34
Hulicat20-Aug-08 16:34 
QuestionVB.net mysql subtract value Pin
Pestinha198420-Aug-08 6:11
Pestinha198420-Aug-08 6:11 
AnswerRe: VB.net mysql subtract value Pin
Blue_Boy20-Aug-08 8:24
Blue_Boy20-Aug-08 8:24 
GeneralRe: VB.net mysql subtract value Pin
Pestinha198420-Aug-08 10:49
Pestinha198420-Aug-08 10:49 
GeneralRe: VB.net mysql subtract value Pin
Blue_Boy20-Aug-08 14:05
Blue_Boy20-Aug-08 14:05 
QuestionPackages in SQL server 2005 Pin
geekfromindia20-Aug-08 5:44
geekfromindia20-Aug-08 5:44 
AnswerRe: Packages in SQL server 2005 Pin
DerekFL20-Aug-08 6:07
DerekFL20-Aug-08 6:07 
Questionmysql data type Pin
dianenacario20-Aug-08 1:34
dianenacario20-Aug-08 1:34 
AnswerRe: mysql data type Pin
TheFM23420-Aug-08 7:13
TheFM23420-Aug-08 7:13 
QuestionA question about the DB construction Pin
makumazan8420-Aug-08 1:00
makumazan8420-Aug-08 1:00 
AnswerRe: A question about the DB construction Pin
TheFM23420-Aug-08 7:22
TheFM23420-Aug-08 7:22 
GeneralRe: A question about the DB construction Pin
makumazan8420-Aug-08 8:46
makumazan8420-Aug-08 8:46 
GeneralRe: A question about the DB construction Pin
TheFM23420-Aug-08 16:10
TheFM23420-Aug-08 16:10 
QuestionForeign Key Column Pin
Subramaniam s.V.19-Aug-08 23:25
Subramaniam s.V.19-Aug-08 23:25 
AnswerRe: Foreign Key Column Pin
Wendelius20-Aug-08 3:01
mentorWendelius20-Aug-08 3:01 

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.