#Parameter1:Datum von:datetime:firstofcurrentyear
#Parameter2:Datum bis:datetime:currentdate
#Parameter3:PatNr:Text:
-SQL-
SELECT        dbo.privat.*, dbo.KG.*, dbo.KG.NrKG AS Expr1
FROM            dbo.privat INNER JOIN
                         dbo.KG ON dbo.privat.nrprivat = dbo.KG.NrPrivat
						 
where dbo.kg.nrprivat=#Parameter3 and dbo.kg.datum>='#Parameter1 00:00:00' and dbo.kg.datum<='#Parameter2 23:59:59' and dbo.kg.aktiv=1
