######################################################################
①번 소스...
procedure Tdh1400_f.StartBitBtnClick(Sender: TObject);
begin
if Loc_sMEdit.Text <= ' ' then Loc_eMEdit.Text := 'zzzzzz';
Query1.disableControls;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add (' select lstk_loc,lstk_stat,lstk_item,mast_name,mast_spec,lstk_stok,lstk_date,lstk_time ');
Query1.SQL.Add (' from dilstk ,dimast ');
Query1.SQL.Add (' where (lstk_item=mast_item(+)) and ((lstk_loc >= '''+loc_sMEdit.Text+''') ');
Query1.SQL.Add (' and (lstk_loc <= '''+loc_eMEdit.Text+''')) ');
Query1.SQL.Add (' order by lstk_loc ');
Query1.open;
Query1.EnableControls;
Loc_sMEdit.Text := Query1.FieldByName('lstk_loc').AsString;
Query1.FindLast;
Loc_eMEdit.Text := Query1.FieldByName('lstk_loc').AsString;
Query1.FindFirst;
if Query1.RecordCount <> 0 then
MesgStatusBar.SimpleText := 'MSAG:' + IntToStr(Query1.RecordCount) + ' 건 조회완료 하였습니다.!!'
else MesgStatusBar.SimpleText := 'MSAG:조회할 자료가 없습니다.!!';
end;
######################################################################
②번 소스...
procedure Tdh1500_f.StartBitBtnClick(Sender: TObject);
begin
if item_sMEdit.Text <= ' ' then item_eMEdit.Text := 'zzzzzzzzzzzzzzzzzzzz';
sitem := item_sMEdit.Text ;
eitem := item_eMEdit.Text ;
Query1.disableControls;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add (' select lstk_loc,lstk_item,lstk_stok,lstk_stat,mast_name,mast_spec,lstk_date ');
Query1.SQL.Add (' from dilstk ,dimast ');
Query1.SQL.Add (' where (lstk_item=mast_item(+)) and ');
Query1.SQL.Add (' ((lstk_item >= '''+sitem+''')and (lstk_item <= '''+eitem+''')) and ');
Query1.SQL.Add (' ( RTRIM(lstk_item) IS NOT NULL ) ');
Query1.SQL.Add (' order by lstk_loc ');
Query1.open;
Query1.EnableControls;
sitem := Query1.FieldByName('lstk_item').AsString;
item_sMEdit.Text := copy(sitem,1,20);
Query1.FindLast;
eitem := Query1.FieldByName('lstk_item').AsString;
item_eMEdit.Text := copy(eitem,1,20);
Query1.FindFirst;
if Query1.RecordCount <> 0 then
MesgStatusBar.SimpleText := 'MSAG:' + IntToStr(Query1.RecordCount) + ' 건 조회완료 하였습니다.!!'
else MesgStatusBar.SimpleText := 'MSAG:조회할 자료가 없습니다.!!';
end;
######################################################################
①②
위의 ①번소스에서 "StartBitBtnClick(조회버튼)"을 클릭하면 제대로 조회가 되는데,②번소스에서 조회를 하면 ①번에 있던 데이타 하나가 빠져서 조회가 됩니다. 왜 이런 현상이 나는 걸까요?
알려주십시요....부탁합니다.