Create view GenStAgentAcctMgr (AgentAcctMgr, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, Generalstatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 18
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStBookingMethod (BookingMethod, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 11
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStCompanyAcctMgr (CompanyAcctMgr, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 17
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStCompany (CompanyCode, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 3
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStMarketArea (MarketArea, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 10
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStMktSegment (MarketSegment, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 2
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode, 
GeneralStatistics.FiscalDate
#
Create view GenStNationality (Nationality, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 14
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStOperatorID (OperatorID, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 12
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStPackage (PackageCode, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 15
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStPromotion (PromotionCode, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 16
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStRateCode (RateCode, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 6
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStResCategory (ResCategory, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 13
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStResidency (ResidencyCode, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 5
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStRoomClass (RoomClass, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 8
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStRoomType (RoomType, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 9
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate
#
Create view GenStTravelAgent (TravelAgent, HotelCode, FiscalDate, RoomArrivals,
RoomNights, GuestNights, RoomRev, FoodRev, BeverageRev, OtherRev)

as select StatisticsXref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate,  sum(GeneralStatistics.RmArr),
sum(GeneralStatistics.RmNts), sum(GeneralStatistics.GstNts),
sum(GeneralStatistics.Room),  sum(GeneralStatistics.Food),
sum(GeneralStatistics.Beverage), sum(GeneralStatistics.Other)

from StatisticsXref, GeneralStatistics

where StatisticsXref.collector = 7
and StatisticsXref.StatsFilePtrSerNum  = GeneralStatistics.SerialNumber
and StatisticsXref.StatsFilePtrDbNum  = GeneralStatistics.DatabaseNumber
and GeneralStatistics.recordtype = 0

group by Statisticsxref.code, GeneralStatistics.HotelCode,
GeneralStatistics.FiscalDate

