top of page

Sage 100 Mandanten-Adressen / Mandator addresses' Sql Script

(alle Versionen/all versions)

Montag, 19. Juni 2023

Hintergrund/Background


Im Sage ERP-System werden wichtige Grundfunktionen wie die Mandanten-Adresse, die Finanzamt-Adresse etc. im Adress-Stamm gespeichert. Dabei werden die Adressen mit einer Sonderfunktion markiert (Feld "KHKAdressen.Sondefunktion").

Um sich über die Adressen in der Datenbank, insbesondere bei mehreren Mandanten, einen schnellen Überblick zu verschaffen, kann das nachfolgende SQL-Script hilfreich sein.


In the Sage ERP system, essential basic functions such as the mandator address, the tax office address, etc., are stored in the address master data section. Those addresses are marked with a special function (field "KHKAdressen.Sondefunktion").

The following SQL script can be helpful to get a quick overview of the addresses in the database, especially if there are several clients.


SQL zum Abfragen der Mandanten-Adressen / SQL to query the mandator addresses

SELECT A.Mandant
 ,M.Wert AS MandantBezeichnung
 ,A.Sonderfunktion
 ,CASE ISNULL(A.Sonderfunktion, 0)
  WHEN 1
   THEN 'Mandant'
  WHEN 2
   THEN 'Finanzamt'
  WHEN 4
   THEN 'Steuerberater'
  WHEN 8
   THEN 'Rechnungsempfänger Mandant'
  WHEN 9
   THEN 'Mandant und Rechnungsempfänger Mandant'
  ELSE '(unbekannt)'
  END AS SonderfunktionZweck
 ,A.Adresse
 ,A.Matchcode
 ,A.Name1
 ,A.LieferPlz
 ,A.LieferOrt
FROM dbo.KHKAdressen AS A WITH (NOLOCK)
INNER JOIN dbo.KHKMandanten AS M WITH (NOLOCK) ON A.Mandant = M.Mandant
 AND M.Eigenschaft = 1
WHERE ISNULL(A.Sonderfunktion, 0) > 0
ORDER BY A.Mandant
 ,A.Sonderfunktion

bottom of page