var
Num:integer;
begin
listView1.Items.Clear;
Num:=1;
Listview1.Items.BeginUpdate;
WHILE Not Dm1.Q_inf1.Eof DO BEGIN
listView1.Items.Add;
ListView1.Items[ListView1.Items.Count-1].SubItems.Add(inttostr(Num));
ListView1.Items[ListView1.Items.Count-1].SubItems.Add(dm1.Q_inf1.fieldbyname('StationID').asstring);
IF Dm1.Q_inf1.fieldbyname('NowDate').asString=''
then ListView1.Items[ListView1.Items.Count-1].SubItems.Add('')
else ListView1.Items[ListView1.Items.Count-1].SubItems.Add(FormatDateTime('YYYY-MM-DD',dm1.Q_inf1.fieldbyname('NowDate').asDateTime));
num:=num+1;
Dm1.Q_inf1.Next;
END;
Listview1.Items.EndUpdate;