Monday, March 12, 2012

I am querying 4 views using a LEFT OUTER JOIN but my data is not complete.

I am querying 4 views that I have created. I am using a LEFT OUTER
JOIN. My results are not including all columns. If a call does not
exist in one of the views, the entire row is left out.
select distinct svc00210.userid, vw_tf_ServiceCallsNew.NewCalls,
vw_tf_ServiceCallsChanged.ChangedCalls,
vw_tf_ServiceCallsClosed.ClosedCalls from
svc00210
LEFT OUTER JOIN vw_tf_ServiceCallsNew on svc00210.userid =
vw_tf_ServiceCallsNew.userid
LEFT OUTER join vw_tf_ServiceCallsChanged on svc00210.userid =
vw_tf_ServiceCallsChanged.userid
LEFT OUTER join vw_tf_ServiceCallsClosed on svc00210.userid =
vw_tf_ServiceCallsClosed.userid
where vw_tf_ServiceCallsNew.creatddt = '03-30-2006' and
vw_tf_ServiceCallsChanged.creatddt = '03-30-2006'
and vw_tf_ServiceCallsClosed.creatddt = '03-30-2006'
Please help!
Thanks!ITry:
select distinct svc00210.userid, vw_tf_ServiceCallsNew.NewCalls,
vw_tf_ServiceCallsChanged.ChangedCalls,
vw_tf_ServiceCallsClosed.ClosedCalls from
svc00210
LEFT OUTER JOIN vw_tf_ServiceCallsNew on svc00210.userid =
vw_tf_ServiceCallsNew.userid
and vw_tf_ServiceCallsNew.creatddt = '03-30-2006'
LEFT OUTER join vw_tf_ServiceCallsChanged on svc00210.userid =
vw_tf_ServiceCallsChanged.userid
and vw_tf_ServiceCallsChanged.creatddt = '03-30-2006'
LEFT OUTER join vw_tf_ServiceCallsClosed on svc00210.userid =
vw_tf_ServiceCallsClosed.userid
and vw_tf_ServiceCallsClosed.creatddt = '03-30-2006'
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Puck" <tahnee.puckett@.bancsourceinc.com> wrote in message
news:1144152702.307997.202650@.g10g2000cwb.googlegroups.com...
I am querying 4 views that I have created. I am using a LEFT OUTER
JOIN. My results are not including all columns. If a call does not
exist in one of the views, the entire row is left out.
select distinct svc00210.userid, vw_tf_ServiceCallsNew.NewCalls,
vw_tf_ServiceCallsChanged.ChangedCalls,
vw_tf_ServiceCallsClosed.ClosedCalls from
svc00210
LEFT OUTER JOIN vw_tf_ServiceCallsNew on svc00210.userid =
vw_tf_ServiceCallsNew.userid
LEFT OUTER join vw_tf_ServiceCallsChanged on svc00210.userid =
vw_tf_ServiceCallsChanged.userid
LEFT OUTER join vw_tf_ServiceCallsClosed on svc00210.userid =
vw_tf_ServiceCallsClosed.userid
where vw_tf_ServiceCallsNew.creatddt = '03-30-2006' and
vw_tf_ServiceCallsChanged.creatddt = '03-30-2006'
and vw_tf_ServiceCallsClosed.creatddt = '03-30-2006'
Please help!
Thanks!I|||Thank you sooooo much!!!

No comments:

Post a Comment