Datev Export sqlGetCounter Example
Available Parameters
- @company - If you work with multiple companies, you have to export each company by it's own.
- @dateFrom - Start date for the export
- @dateUntil - End date for the export
Example Usages
SELECT MAX(DatevExportId) FROM
(
SELECT ISNULL(MAX(cordDatevExportId), 0) AS DatevExportId FROM customerOrder WHERE cordCompanyId = @company
UNION ALL
SELECT ISNULL(MAX(sordDatevExportId), 0) AS DatevExportId FROM supplierOrder WHERE sordCompanyId = @company
) AS sub