alter view "DBA".v_NewArriveStayLeaveGuestBook as select GuestNum=Guest,GuestName=min(G."Name"), ArriveDate=Min(Book.DateRegDt), LastRoom=MAX(if Book.Staying=2 then 0 else Book.Room endif), NumNights=Sum(Book.NumLodgings), LeaveDate=Days(ArriveDate,NumNights), // Yanko + // RegPrice=max(Book.Price||' '||C.Symbol), RegPrice=Book.Price||' '||C.Symbol, // Yanko - PayNightPrice=sum(Book.PayedLodgings*Book.Price*DR.ExchangeRate), Admin=Max(Admin.FullName) from "DBA".Book,"DBA".Admin,"dba".Guests as G,"dba".DayRates as DR ,"dba".Currencies as C where Book.KodAdmin=Admin.AdminNo and Book.IsRest<>1 and Book.Guest=G.GuestNum and DR.KodCurrency=Book.KodCurrency and DR.DateDt=Book.DateRegDt and C.KodCurrency=Book.KodCurrency group by Guest,RegPrice //[v. 22.06.2006]