07. august 2003 - 16:16
#3
Captur50_OrderRep_Personalrep:
SELECT dbo.OrderRep_OldAndNew.Art, dbo.OrderRep_OldAndNew.Comp, dbo.OrderRep_OldAndNew.Account1,
dbo.OrderRep_OldAndNew.Account2, dbo.OrderRep_OldAndNew.ProductCode, dbo.OrderRep_OldAndNew.Supplier, dbo.OrderRep_OldAndNew.Dest,
dbo.OrderRep_OldAndNew.Createdate, dbo.OrderRep_OldAndNew.Depdate, dbo.OrderRep_OldAndNew.Retdate, dbo.OrderRep_OldAndNew.Invdate,
dbo.OrderRep_OldAndNew.FareAmount, dbo.OrderRep_OldAndNew.Acceptance, dbo.OrderRep_OldAndNew.CrsMethod,
dbo.OrderRep_OldAndNew.RoomCount, dbo.OrderRep_OldAndNew.Conference, dbo.OrderRep_OldAndNew.Carcomp,
dbo.OrderRep_OldAndNew.CarGroup, dbo.OrderRep_OldAndNew.LowPrice, dbo.OrderRep_OldAndNew.Okay, dbo.OrderRep_OldAndNew.PNRNo,
dbo.OrderRep_OldAndNew.Roomtype, dbo.OrderRep_OldAndNew.Tekst, dbo.OrderRep_OldAndNew.Shorttxt, dbo.OrderRep_OldAndNew.AreaName,
dbo.OrderRep_OldAndNew.FeeAmount, dbo.OrderRep_OldAndNew.Routing, dbo.OrderRep_OldAndNew.AcceptCode,
dbo.OrderRep_OldAndNew.AcceptTextDK, dbo.OrderRep_OldAndNew.AcceptTextEng, dbo.OrderRep_OldAndNew.CompName,
dbo.OrderRep_OldAndNew.CompGroup, dbo.OrderRep_OldAndNew.DestAir, dbo.OrderRep_OldAndNew.DestCountry,
dbo.OrderRep_OldAndNew.HtlName, dbo.OrderRep_OldAndNew.ProductName, dbo.OrderRep_OldAndNew.SupplierName,
dbo.OrderRep_OldAndNew.ConAmount, dbo.OrderRep_OldAndNew.ConCurrency, dbo.OrderRep_OldAndNew.ConDKKAmount,
dbo.OrderRep_OldAndNew.ConDKKFactor, dbo.OrderRep_OldAndNew.ConFactor, dbo.OrderRep_OldAndNew.ConLowPrice, dbo.Personalrep.Enavn,
dbo.Personalrep.Fnavn, dbo.Personalrep.Mnavn, dbo.Personalrep.Init, dbo.Personalrep.Longinit, dbo.Captur50_OrderPartNr.Allocname,
dbo.Captur50_OrderPartNr.Allocnum, dbo.Captur50_OrderPartNr.Amount, dbo.Captur50_OrderPartNr.Capuserid,
dbo.Captur50_OrderPartNr.Capusernum, dbo.Captur50_OrderPartNr.Catmethod, dbo.Captur50_OrderPartNr.Catname,
dbo.Captur50_OrderPartNr.Catseg1, dbo.Captur50_OrderPartNr.Catseg2, dbo.Captur50_OrderPartNr.Catsplitid, dbo.Captur50_OrderPartNr.Custom1,
dbo.Captur50_OrderPartNr.Custom2, dbo.Captur50_OrderPartNr.Custom3, dbo.Captur50_OrderPartNr.Debcre, dbo.Captur50_OrderPartNr.Department,
dbo.Captur50_OrderPartNr.Exportdate, dbo.Captur50_OrderPartNr.Paymethod, dbo.Captur50_OrderPartNr.Locname,
dbo.Captur50_OrderPartNr.Saechar4, dbo.Captur50_OrderPartNr.Saeflag1, dbo.Captur50_OrderPartNr.Stdaccexid,
dbo.Captur50_OrderPartNr.Submisdesc, dbo.Captur50_OrderPartNr.Submisname, dbo.Captur50_OrderPartNr.Tracountry,
dbo.Captur50_OrderPartNr.Transdate, dbo.Captur50_OrderPartNr.Transtype, dbo.Captur50_OrderPartNr.Tripname,
dbo.Captur50_OrderPartNr.Vendorname, dbo.Captur50_OrderPartNr.Exportid, dbo.CompGrp.Groupname AS CompGroupName,
dbo.CompGrp.Currency AS CompGroupCurrency, dbo.Captur50_OrderPartNr.OrderPartNr AS Cap5OrderPartNr,
dbo.OrderRep_OldAndNew.OrderPartNr AS TMSOrderPartNr, dbo.OrderRep_OldAndNew.CapVersion, dbo.Personalrep.Admonly
FROM dbo.CompGrp INNER JOIN
dbo.OrderRep_OldAndNew ON dbo.CompGrp.Groupcode = dbo.OrderRep_OldAndNew.CompGroup LEFT OUTER JOIN
dbo.Captur50_OrderPartNr ON dbo.OrderRep_OldAndNew.OrderPartNr = dbo.Captur50_OrderPartNr.OrderPartNr LEFT OUTER JOIN
dbo.Personalrep ON dbo.OrderRep_OldAndNew.Init = dbo.Personalrep.Init
07. august 2003 - 16:17
#4
OrderRep_OldAndNew:
SELECT *
FROM (SELECT Orderrep.Ordernr + Orderrep.Partnr AS OrderPartNr, orderrep.Ordernr, orderrep.Partnr, orderrep.Cre_partnr, orderrep.Fak_kre, orderrep.Art,
orderrep.Init, orderrep.InvoiceNo, orderrep.Comp, orderrep.Account1, orderrep.Account2, orderrep.Account3, orderrep.ProductCode,
orderrep.Mcc, orderrep.Supplier, orderrep.Dest, orderrep.Createdate, orderrep.Depdate, orderrep.Retdate, orderrep.Invdate,
orderrep.Tckexpire, orderrep.Tckreceive, orderrep.FareAmount, orderrep.Fare, orderrep.CarrGrant, orderrep.Commission, orderrep.Tax,
orderrep.Fee, orderrep.Vat, orderrep.Crfee, orderrep.Crvat, orderrep.CompPrice, orderrep.FullFare, orderrep.Acceptance, orderrep.Agent,
orderrep.Breakfast, orderrep.Carcomp, orderrep.Conference, orderrep.RoomCount, orderrep.Crs, orderrep.CrsMethod, orderrep.Dep_fak,
orderrep.Dep_fak_ok, orderrep.Destcode, orderrep.DropOff, orderrep.Ext_apdate, orderrep.FOPayment, orderrep.CarGroup,
orderrep.HandInv, orderrep.HandOrd, orderrep.Hidden, orderrep.HtlCRSReg, orderrep.Htlno, orderrep.InvDetails, orderrep.LowPrice,
orderrep.Okay, orderrep.Pax, orderrep.PickUp, orderrep.PNRNo, orderrep.Requester, orderrep.Reqno, orderrep.Resref, orderrep.Returntrip,
orderrep.Roomtype, orderrep.Serialno, orderrep.Shorttxt, orderrep.Tekst, orderrep.Tickettype, orderrep.Units, orderrep.LocalAmount,
orderrep.CarKM, orderrep.BilledCur, orderrep.LocalCur, orderrep.Ext_aprovd, orderrep.Ext_fileid, orderrep.Ext_hold, orderrep.Ext_id,
orderrep.AreaName, orderrep.FeeName, orderrep.AreaCode, orderrep.FeeAmount, orderrep.FeeNo, orderrep.Routing,
orderrep.AirMileageTotal, orderrep.Flights, orderrep.AcceptCode, orderrep.AcceptTextDK, orderrep.AcceptTextEng, orderrep.CompName,
orderrep.CompAdr, orderrep.CompZip, orderrep.CompCity, orderrep.CompCountry, orderrep.CompGroup, orderrep.DestAir, orderrep.DestCity,
orderrep.DestState, orderrep.DestCountry, orderrep.HtlName, orderrep.HtlAddress, orderrep.HtlZip, orderrep.HtlCity, orderrep.HtlCountry,
orderrep.FullName, orderrep.Account4, orderrep.Account5, orderrep.ProductName, orderrep.SupplierName, orderrep.CompGroupName,
orderrep.Nofee, orderrep.Ratediff, orderrep.Ratelock, orderrep.Ratetrans, orderrep.MainCarrier, orderrep.BookingClass, orderrep.Fee2cap,
orderrep.ProductLevel1, orderrep.ProductLevel1Name, orderrep.ProductLevel2, orderrep.ProductLevel2Name, orderrep.ProductAreaCode,
orderrep.ProductAreaName, orderrep.Normalfare, orderrep.NormalFareIndex, orderrep.ConAmount, orderrep.ConCurrency,
orderrep.ConDKKAmount, orderrep.ConDKKFactor, orderrep.ConFactor, orderrep.Card, orderrep.CapturaSend, orderrep.Fee2,
Orderrep.ProductCode + Orderrep.Supplier AS ProductSupplier, LowPrice * ConFactor AS ConLowPrice, 4.1 AS CapVersion
FROM TMS.dbo.Orderrep Orderrep
WHERE (Orderrep.Createdate >= '01-01-2001') AND (SerialNo <> '-5')
UNION ALL
SELECT Orderrep.Ordernr + Orderrep.Partnr AS OrderPartNr, orderrep.Ordernr, orderrep.Partnr, orderrep.Cre_partnr, orderrep.Fak_kre, orderrep.Art,
orderrep.Init, orderrep.InvoiceNo, orderrep.Comp, orderrep.Account1, orderrep.Account2, orderrep.Account3, orderrep.ProductCode,
orderrep.Mcc, orderrep.Supplier, orderrep.Dest, orderrep.Createdate, orderrep.Depdate, orderrep.Retdate, orderrep.Invdate,
orderrep.Tckexpire, orderrep.Tckreceive, orderrep.FareAmount, orderrep.Fare, orderrep.CarrGrant, orderrep.Commission, orderrep.Tax,
orderrep.Fee, orderrep.Vat, orderrep.Crfee, orderrep.Crvat, orderrep.CompPrice, orderrep.FullFare, orderrep.Acceptance, orderrep.Agent,
orderrep.Breakfast, orderrep.Carcomp, orderrep.Conference, orderrep.RoomCount, orderrep.Crs, orderrep.CrsMethod, orderrep.Dep_fak,
orderrep.Dep_fak_ok, orderrep.Destcode, orderrep.DropOff, orderrep.Ext_apdate, orderrep.FOPayment, orderrep.CarGroup,
orderrep.HandInv, orderrep.HandOrd, orderrep.Hidden, orderrep.HtlCRSReg, orderrep.Htlno, orderrep.InvDetails, orderrep.LowPrice,
orderrep.Okay, orderrep.Pax, orderrep.PickUp, orderrep.PNRNo, orderrep.Requester, orderrep.Reqno, orderrep.Resref, orderrep.Returntrip,
orderrep.Roomtype, orderrep.Serialno, orderrep.Shorttxt, orderrep.Tekst, orderrep.Tickettype, orderrep.Units, orderrep.LocalAmount,
orderrep.CarKM, orderrep.BilledCur, orderrep.LocalCur, orderrep.Ext_aprovd, orderrep.Ext_fileid, orderrep.Ext_hold, orderrep.Ext_id,
orderrep.AreaName, orderrep.FeeName, orderrep.AreaCode, orderrep.FeeAmount, orderrep.FeeNo, orderrep.Routing,
orderrep.AirMileageTotal, orderrep.Flights, orderrep.AcceptCode, orderrep.AcceptTextDK, orderrep.AcceptTextEng, orderrep.CompName,
orderrep.CompAdr, orderrep.CompZip, orderrep.CompCity, orderrep.CompCountry, orderrep.CompGroup, orderrep.DestAir, orderrep.DestCity,
orderrep.DestState, orderrep.DestCountry, orderrep.HtlName, orderrep.HtlAddress, orderrep.HtlZip, orderrep.HtlCity, orderrep.HtlCountry,
orderrep.FullName, orderrep.Account4, orderrep.Account5, orderrep.ProductName, orderrep.SupplierName, orderrep.CompGroupName,
orderrep.Nofee, orderrep.Ratediff, orderrep.Ratelock, orderrep.Ratetrans, orderrep.MainCarrier, orderrep.BookingClass, orderrep.Fee2cap,
orderrep.ProductLevel1, orderrep.ProductLevel1Name, orderrep.ProductLevel2, orderrep.ProductLevel2Name, orderrep.ProductAreaCode,
orderrep.ProductAreaName, orderrep.Normalfare, orderrep.NormalFareIndex, orderrep.ConAmount, orderrep.ConCurrency,
orderrep.ConDKKAmount, orderrep.ConDKKFactor, orderrep.ConFactor, orderrep.Card, orderrep.CapturaSend, orderrep.Fee2,
Orderrep.ProductCode + Orderrep.Supplier AS ProductSupplier, LowPrice * ConFactor AS ConLowPrice, 5.2 AS CapVersion
FROM TMS_EPT.dbo.Orderrep Orderrep
WHERE (Orderrep.Createdate >= '01-01-2001')) x