Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an app that calculates billing for customers based on their location for the current month. I customer could be on both locations for the current month. How do I prevent them from being billed twice? Attaches is my code. Thank you
[Billing Extract]:
Load
text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today()))as [Session ID],
Date(MonthStart(Today()), 'D-MMM-YY') as [Session Date],
text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today()))& '-'& num(DocumentCounter,000) as [Document Number],
[Fee Monthly Rate] & '-' & Date([Billing Start Date],'D-MMM-YY') & ' TO ' & Date([Billing End Date],'D-MMM-YY') & ' - ' & [Days for Calculation] & ' NIGHTS' as Description,
"Employee ID" ,
"Last Name" & "First Name" as [Employee Name],
'41140' as [GG Code],
'425' as [Department Code],
'' as Debit,
[Monthly Fee] as Credit,
Resident [ Fee Billing]
Where [Location Code] ='03';
Load
text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today())) as [Session ID],
Date(MonthStart(Today()), 'D-MMM-YY') as [Session Date],
text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today()))& '-'& num(DocumentCounter,000) as [Document Number],
[ Fee Monthly Rate] & '-' & Date([Billing Start Date],'D-MMM-YY') & ' TO ' & Date([Billing End Date],'D-MMM-YY') & ' - ' & [Days for Calculation] & ' NIGHTS' as Description,
"Employee ID" ,
"Last Name" & "First Name" as [Employee Name],
'41140' as [GG Code],
'425' as [Department Code],
'' as Debit,
[Monthly Fee] as Credit,
Resident [Fee Billing]
Where [Location Code] ='04';
You Can use the "Exists" function to remove the customers from the second table.
Exists function will help you not load the customer information which is already loaded above.
You Can use the "Exists" function to remove the customers from the second table.
Exists function will help you not load the customer information which is already loaded above.
Thank you