The mailmessagesreceived
and mailmessagessent
of Exact Online contain all work for all divisions of a customer. To retrieve them in our SQL Server database we use the following query:
use select min(code) from systemdivisions group by customercode
By using the min
we ensure that the division code stays constant over time per customer code.
And then load the data:
select /*+ ods(true, interval '20 hours') */ * from mailmessagessent
select /*+ ods(true, interval '20 hours') */ * from mailmessagesreceived
However, the field ForDivision
is in general empty. It is only filled for bank statements such as MT940.
For companies that have their own subscription on Exact Online, that is not a problem. The min(code)
then is their own division.
But we need to assess for all divisions under our accountancy subscription what the amount of work to be done is per division.
How can we associate the mailmessagesreceived
and the mailmessagessent
to their Exact Online division?