select stok_kodu, fisno ,STHAR_TARIH from tblsthar where fisno=(select tblfatuek.fatirsno from tblfatuek
where tblfatuek.acik14='A6227')
Kodumuz normalde problemsiz çalışıyor, ama hesap etmediğim bir sorun çıktı.
alt sorgudan dönen değer çok nadirde olsa birden fazla olunca hata veriyor
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Bu halde ana sorguyu while not ...eof döngüsüne sokmadan tek bir sorguda halledebilir miyiz?
Erbab-ı kemâli çekemez nakıs olan, rencide olur Dide-i Huffaş ziyadan....
qstokbul2.Close;
qstokbul2.SQL.Clear;
qstokbul2.SQL.Add('select '+netsisdb+'.dbo.tblsthar.stok_kodu, '+netsisdb+'.dbo.tblfatuek.'+KABULNOALAN+','+netsisdb+'.dbo.tblfatuek.fatirsno, kabul.kabulno, plaka.plaka, plaka.saseno, plaka.musno, plaka.aracadi from kabul inner join ');
qstokbul2.SQL.Add('plaka on kabul.plaka=plaka.plaka');
qstokbul2.SQL.Add('inner join '+netsisdb+'.dbo.tblfatuek on kabul.kabulno='+netsisdb+'.dbo.tblfatuek.'+KABULNOALAN+'');
qstokbul2.SQL.Add('inner join '+netsisdb+'.dbo.tblsthar on '+netsisdb+'.dbo.tblsthar.fisno='+netsisdb+'.dbo.tblfatuek.fatirsno');
qstokbul2.SQL.Add('where saseno like :m');
qstokbul2.SQL.Add(' and '+netsisdb+'.dbo.tblsthar.stok_kodu like :mm');
qstokbul2.SQL.Add('order by '+netsisdb+'.dbo.tblsthar.fisno asc');
qstokbul2.Parameters[0].Value:='%'+edit1.text+'%';
qstokbul2.Parameters[1].Value:='%'+edit3.text+'%';
QSTOKBUL2.Open;
Erbab-ı kemâli çekemez nakıs olan, rencide olur Dide-i Huffaş ziyadan....
Sıradan her programcı bilgisayarın anlayabileceği kodlar yazabilir.
Sadece iyi programcılar insanların da anlayabileceği kodlar yazarlar.
Martin Fowler (http://martinfowler.com/)