Datev Export sqlGetCounter Example

This is the main script, which is responsible for collection all the data, which needs to be exported.

Available Parameters

  1. @company - If you work with multiple companies, you have to export each company by it's own.

  2. @dateFrom - Start date for the export

  3. @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

Last updated