Datev Export sqlMainData Example
This is the script, which is responsible for collection all the address data, which needs to be exported.
Available Parameters
Example Usages
SELECT adr.id AS Kundennummer,
CASE WHEN adrIsCustomer = 1 THEN adr.adrDebitor ELSE adr.adrKreditor END AS Konto,
adr.adrName AS Firmenname,
adr.adrLastName as Nachname,
adr.adrFirstName as Vorname,
'' AS Anrede,
'STR' AS Adresstyp,
adrLoc.alocStreet AS Strasse,
adrLoc.alocStreetNumber AS Hausnummer,
adrLoc.alocZip AS PLZ,
adrLoc.alocCity AS Stadt,
adrLoc.alocAdditionalInfo AS Zusatzinformation
FROM [dbo].[address] AS adr
LEFT JOIN addressLocation AS adrLoc ON adrLoc.id = adr.adrDefaultInvoiceAddress
LEFT JOIN country AS country ON country.id = adrLoc.alocCountryId
WHERE adr.adrIsCustomer = 1 OR adr.adrIsSupplier = 1Last updated