SELECT ClaimsBatchMasterUNIONQuery.PolicyNumber AS [Policy Number], ClaimsBatchMasterUNIONQuery.DOB AS [Patient Date of Birth], ClaimsBatchMasterUNIONQuery.MemberLastName AS Surname, ClaimsBatchMasterUNIONQuery.MemberFirstName AS [First Name], "" AS Empty01, "" AS Empty02, IIf(IsNull([ClaimsBatchMasterUNIONQuery]![PracticeReferenceNumber]),[ClaimsBatchMasterUNIONQuery]![CIInvoiceNumber],[ClaimsBatchMasterUNIONQuery]![PracticeReferenceNumber] & "-" & [ClaimsBatchMasterUNIONQuery]![CIInvoiceNumber]) AS [Provider Invoice Number], ClaimsBatchMasterUNIONQuery.PractitionerName AS [Provider Name], "" AS Empty03, "GBR" AS [Country of Treatment Code], ClaimsBatchMasterUNIONQuery.NonDiscountedAmount AS [Original Invoice Amount], "GBP" AS [Invoice Currency Code], ClaimsBatchMasterUNIONQuery.DataEntryDate AS [Invoice Date], [ClaimsBatchMasterUNIONQuery]![NonDiscountedAmount]-[ClaimsBatchMasterUNIONQuery]![DiscountedAmount] AS Discount, 0 AS ZeroField, ClaimsBatchMasterUNIONQuery.[Treatement Date] AS [Treatment From Date], ClaimsBatchMasterUNIONQuery.[Treatement Date] AS [Treatment To Date], [ClaimsBatchMasterUNIONQuery]![DiscountedAmount] AS [Amount to Pay], "KSASTUD-D" AS [KSASTUD-D], "" AS Empty04, "" AS Empty05, "Z01.2" AS ZField, "Dental Examination" AS [Dental Examination], "" AS Empty06, [ClaimsBatchMasterUNIONQuery]![Procedure] AS [Child Exam], ClaimsBatchMasterUNIONQuery.DentalPracticeName
FROM ClaimsBatchMasterUNIONQuery
WHERE (((ClaimsBatchMasterUNIONQuery.DataEntryDate)>=[Forms]![InvoiceOutputParameterDateForm]![StartDateTxtBx] And (ClaimsBatchMasterUNIONQuery.DataEntryDate)<=[Forms]![InvoiceOutputParameterDateForm]![EndDateTxtBx]) AND ((ClaimsBatchMasterUNIONQuery.DentalPracticeName)=[Forms]![InvoiceOutputParameterDateForm]![DentalPracticeNameTxtBx]) AND ((ClaimsBatchMasterUNIONQuery.Procedure) Is Not Null) AND ((ClaimsBatchMasterUNIONQuery.NonSaudiMbr)=[Forms]![InvoiceOutputParameterDateForm]![NonSaudiProviderCkBx]));