Einzelnen Beitrag anzeigen

omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: Abfrage als SQL-Statement

  Alt 30. Jul 2007, 23:51
Hallo HolgerCW,

vielleicht so...
SQL-Code:
SELECT
  CASE WHEN druckliterprodukt = 'PS x V
    THEN
      CASE
        WHEN ps_x >= katart1v AND ps_x <= katart2v THEN 'Art.3, Abs.3'
        WHEN ps_x >= kat11v AND ps_x <= kat12v THEN 'I'
        WHEN ps_x >= kat21v AND ps_x <= kat22v THEN 'II'
        WHEN ps_x >= kat31v AND ps_x <= kat32v THEN 'III'
        WHEN ps_x >= kat41v AND ps_x <= kat42v THEN 'IV'
      END
    ELSE
      CASE
        WHEN ps_x >= katart1dn AND ps_x <= katart2dn THEN 'Art.3, Abs.3'
        WHEN ps_x >= kat11dn AND ps_x <= kat12dn THEN 'I'
        WHEN ps_x >= kat21dn AND ps_x <= kat22dn THEN 'II'
        WHEN ps_x >= kat31dn AND ps_x <= kat32dn THEN 'III'
        WHEN ps_x >= kat41dn AND ps_x <= kat42dn THEN 'IV'
      END
  END AS kategorie_x
FROM tabelle
Gruss
Thorsten
  Mit Zitat antworten Zitat