I wrote the union query of queries A and B. When I execute each seperatly it works. When I execute A Union B I get "Division by zero" error. Does not make too much sense. Any idea?
SELECT ID, Film, Name, MovieRelDate, StatementDate, [Domestic Theatrical Distribution Expenses Calculated], [Domestic HV Distribution Expenses Calculated], [Domestic Other Distribution Expenses Calculated], [Domestic Distribution Expenses Calculated], [Domestic Distribution Fees Calculated], [International Theatrical Distribution Expenses Calculated], [International HV Distribution Expenses Calculated], [International Other Distribution Expenses Calculated], [International Distribution Expenses Calculated], [International Distribution Fees Calculated], [International Sales Fees], [Total Revenues], [Total Receipts], [Total Distribution Expenses Calculated], [Total Cost of production], [Total Net Proceeds to Studio], [Total Distribution Fees Calculated], [DomesticBO Calculated] As [DomesticBO], [Domestic Theatrical Rentals], [Domestic HV Gross Revenue], [Domestic Pay TV Revenue], [Domestic Free TV Revenue], [Domestic TV Revenue Calculated], [Domestic VOD/PPV Revenue], [Domestic Other Revenue], [Domestic Receipts], [Domestic Revenues], [InternationalBO Calculated] As [InternationalBO], [International Theatrical Rentals (Direct)], [International HV Gross Revenue], [International Pay TV Revenue], [International Free TV Revenue], [International TV Revenue Calculated], [International VOD/PPV Revenue], [International Other Revenue], [International Receipts], [International Revenues], [Total Payout to Participants]
FROM [QryReportBase_CalculatedAll Step 3]
UNION SELECT A.FilmID, A.Film, A.Name, A.MovieRelDate, A.StatementDate, A.[Domestic Theatrical Distribution Expenses Calculated], A.[Domestic HV Distribution Expenses Calculated], A.[Domestic Other Distribution Expenses Calculated], A.[Domestic Distribution Expenses Calculated], A.[Domestic Distribution Fees Calculated], A.[International Theatrical Distribution Expenses Calculated], A.[International HV Distribution Expenses Calculated], A.[International Other Distribution Expenses Calculated], A.[International Distribution Expenses Calculated], A.[International Distribution Fees Calculated], "" AS [International Sales Fees], A.[Total Revenues], A.[Total Receipts], A.[Total Distribution Expenses Calculated], A.[Total Cost of production], A.[Total Net Proceeds to Studio] AS Expr2, A.[Total Distribution Fees Calculated], [DomesticBO] , [Domestic Theatrical Rentals], [Domestic HV Gross Revenue], [Domestic Pay TV Revenue], [Domestic Free TV Revenue], [Domestic TV Revenue Calculated], [Domestic VOD/PPV Revenue], [Domestic Other Revenue], [Domestic Receipts], [Domestic Revenues], 0 As [InternationalBO], [International Theatrical Rentals (Direct)], [International HV Gross Revenue], [International Pay TV Revenue], [International Free TV Revenue], [International TV Revenue Calculated], [International VOD/PPV Revenue], [International Other Revenue], [International Receipts], [International Revenues], 0
FROM [Existing Data] AS A
WHERE (((A.FilmID) Not In (Select B.ID from [QryReportBase_CalculatedAll Step 3] AS B WHERE FilmID = B.ID AND StatementDate = B.StatementDate)));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.