★ ★蓝天★ Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-16 #1 请问:怎么样来快速地判断一个表中的某一字段里的值全为空?就是说整个一列为空,如果 我有一个表table1,怎么样判断 其中的字段 field3 里的值为空、
Q qdyoung Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-16 #2 table1.FieldByName('field3').IsNull 或者 table1.FieldByName('field3').AsString = '' 都说明为空 ----- http://www.8421.org
table1.FieldByName('field3').IsNull 或者 table1.FieldByName('field3').AsString = '' 都说明为空 ----- http://www.8421.org
★ ★蓝天★ Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-16 #4 我是指判断整个一列为空。并不是指某一记录的此字段值为空。看仔细了
L LGXing Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-16 #5 Query1.SQL.Text:='Select 1 From TableName Where TheField is Not Null'; Query1.Open; If Query1.IsEmpty Then //全为空;
Query1.SQL.Text:='Select 1 From TableName Where TheField is Not Null'; Query1.Open; If Query1.IsEmpty Then //全为空;
Q qdyoung Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-16 #6 function ColumnIsEmpty(FieldName: string): Boolean; begin Result := True; with Query1 do begin First; while not Eof do begin if not FieldByName(FieldName).IsNull then begin Result := False; Break; end; end; end; end;
function ColumnIsEmpty(FieldName: string): Boolean; begin Result := True; with Query1 do begin First; while not Eof do begin if not FieldByName(FieldName).IsNull then begin Result := False; Break; end; end; end; end;