Einzelnen Beitrag anzeigen

EarlyBird

Registriert seit: 29. Mär 2007
235 Beiträge
 
#2

AW: If Clausel im Select

  Alt 17. Jun 2014, 17:06
So könnte es eventuell gehen:
(ungetestet)
Code:
select K.Datum,
'',
LTrim(P.PersNr),
P.Name,
P.Vorname,
Case K.Konto = '177' then K.Saldo else NULL END as Saldo177 ,
Case K.Konto = '189' then K.Saldo else NULL END as Saldo189,
Case K.Konto = '194' then K.Saldo else NULL END as Saldo194 
from Kontenstand as K, Personalstamm as P
where (K.PersId=P.Identifikation)
and
((K.Konto='177')or(K.Konto='189')or(K.Konto='194') )
and
(((K.Datum) = CURRENT_DATE()-3)) and (K.Saldo <> '')
  Mit Zitat antworten Zitat