Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.48 KB | None | 0 0
  1. select Sys.StartDate, Sys.EndDate, Sys.ECN, Fee.Route, Sys.LiqFlag
  2. from VanDam.dbo.IsSystematic as Sys
  3. LEFT join (Select Route, Flag, Fee, ExchProfile, MAX(EndDate) as EndDate, MIN(StartDate)as StartDate
  4.             from VanDam.dbo.FeeSchedule
  5.             GROUP BY Route,ExchProfile, Tape, Flag,Tier, Fee, Type) as Fee on Fee.StartDate=Sys.StartDate  
  6.             and  Sys.EndDate= Fee.EndDate
  7.             and Sys.ECN=Fee.ExchProfile
  8.             and Sys.LiqFlag=Fee.Flag
  9.             and Fee.Fee = Sys.[Real Rate Per Share for Flag]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement