joining in a query

bonovox12

Board Regular
Joined
Dec 21, 2007
Messages
128
hi,this query works fine but for cases where there are ratefixdtes in swds and frdt, it brings back entries individually. i need to join these. Could somebody help me do this. Thanks!











select s1.RateFixDte, s.RateCode, s.intccy, (sum(s.prinamt)/1000000)as 'Total Refix'

from swds s join swdh h on s.DealNo = h.DealNo
join swds s1 on s1.DealNo = s.DealNo and s1.Seq = s.Seq and s1.SchdSeq = s.SchdSeq - 1 and s1.FixFloatInd = s.FixFloatInd
where s.SchdType <> 'V' and s.FixFloatInd = 'L' and h.Revdate is null and s1.ratefixdte>= '1 june 2008' and s1.ratefixdte< '30 june 2008' and s.ratecode='3mlibgb' and
h.ProdType in('SP','cs') and h.port in ('me') and h.activeind='y' and
h.Trad in ('me')and s.princcy in ('gbp','usd') and
rtrim(h.trad)+rtrim(s.princcy) not in ('meur', 'reur')
group by s1.RateFixDte,s.IntStrtDte, s.RateCode,s.intccy
Union
select t.ratefixdte , t.RateCode, t.ccy, (Sum(t.ccyamt) / 1000000) as 'Total Refix'
from opicslive.dbo.FRDt t where t.revdate is null and t.product='FRA' and t.Trad='Me' and
t.ratefixdte>= '1 june 2008' and t.ratecode= '3mlibgb'
Group by t.ratefixdte, t.RateCode, t.ccy
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top