(26-04-2022, Saat: 10:34)hi_selamlar Adlı Kullanıcıdan Alıntı: Merhaba,
MySQL olarak düzenlenmiş bir SQL cümlesi.
Hangi DB'yi kullandığınızı bilmediğim için.
Kolay gelsin.
Bende SQL göre düzenledim çalışıyor ama boşluklara NULL yazıyor onu boşluk nasıl yaparım ?
SELECT CASE WHEN STOK_KODU IS NOT NULL THEN STOK_KODU else null end as STOK_KODU, case WHEN STOK_KODU IS NOT NULL then FISNO else null end as FISNO FROM TBLSTHAR group by FISNO,STOK_KODU with rollup having FISNO is not null
(26-04-2022, Saat: 10:44)cinarbil Adlı Kullanıcıdan Alıntı:(26-04-2022, Saat: 09:56)OZCANK Adlı Kullanıcıdan Alıntı: Ben şöyle bir kod buldum uyarladım ama renklendirme yapmadı.
if StokKontrol.FieldByName('FISNO').AsString = DBGrid3.DataSource.DataSet.FieldByName('FISNO').AsString Then begin DBGrid3.Canvas.Font.Color:=clWhite; DBGrid3.Canvas.Brush.Color:=clBlack; end; if DataCol = 0 then DBGrid3.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;
Teşekkür ederim. Uyarlayıp kullandım ama hata veriyor
SELECT case STOK_KODU IS NOT NULL when true then STOK_KODU else null end as STOK_KODU, case STOK_KODU IS NOT NULL when true then FISNO else null end as FISNO FROM TBLSTHAR group by FISNO, STOK_KODU with rollup having FISNO is not null
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'IS'.
Msg 319, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
Çalışan kod burada 1. satırı farkı renk 2. satırı farklı kaydet olarak yaptım
bu değiştirerek kendine göre uyarla
procedure Tmusterifrm.grid_musteriDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if data_form.musteri_sorgu.RecNo and 1 = 1 then begin grid_musteri.Canvas.Brush.Color:=$009BE3FF; grid_musteri.DefaultDrawColumnCell(Rect, DataCol, Column, State); end else begin grid_musteri.Canvas.Brush.Color:=clwhite; grid_musteri.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; if gdSelected in State then grid_musteri.Canvas.Brush.Color := $00FDC7AA; grid_musteri.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;
Aynı FISNO aynı olanlar bir renk olsun tek olanlar beyaz nasıl yapabilirim?

