HighDots Forums  

Strange behainvor with "When" clausule

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Strange behainvor with "When" clausule in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Zwi2000
 
Posts: n/a

Default Strange behainvor with "When" clausule - 07-24-2004 , 08:34 AM






Hi,

I have a query that makes a left join to one table, problem is that when I
add a "When" for that table the results displayed are only for records in
which the left join exists and all other records are left out. How can I
change it so that it displays all the other records and those in which the
left join is true and the condition is true ?

This is the code without the condition (Displays all records, those when
there is a left join and those with no conection to that table).

Select distinct a.id,a.caseid,b.FirstNm,b.LastNm from cases a
inner join users as b
on a.alienid = b.userid
Inner join Processcatalog as e on a.process = e.ProcesscatalogID
left join Users as f on a.empid = f.userid
left join Activities as g on a.id = g.caseid
WHERE a.firmid = 1 AND g.acttype = 'history'


This is the code with the condition (Once the condition for the left join is
added results returned are only for records where there the left join
exists, all others are left out .. )

Select distinct a.id,a.caseid,b.FirstNm,b.LastNm from cases a
inner join users as b
on a.alienid = b.userid
Inner join Processcatalog as e on a.process = e.ProcesscatalogID
left join Users as f on a.empid = f.userid
left join Activities as g on a.id = g.caseid
WHERE a.firmid = 1 AND g.acttype = 'history'
and (g.Lastmodified IS NOT NULL AND g.Dateinitiated IS NULL)

I hope I explained correctly..... Please HELP !!!

Z



Reply With Quote
Reply




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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.