|
Field := FieldName;
if NonMatching then
Result := '''' not ( ''''
else
Result := '''' ( '''';
if AnsiUpperCase(FilterValue) = ''''NULL'''' then
begin
Result := Result + Format(''''%s is NULL) '''', [Field]);
exit;
end;
if FieldType = ftString then
begin
if CaseSensitive then
case MatchType of
fdMatchStart:
Result := Result + Format(''''%0:s starting with :%1:sFilter ) '''', [Field, FieldName]);
fdMatchAny:
Result := Result + Format(''''%0:s containing :%1:sFilter ) '''', [Field, FieldName]);
fdMatchEnd :
Result := Result + Format(''''%0:s = :%1:sFilter ) '''', [Field, FieldName]);
fdMatchExact :
Result := Result + Format(''''%0:s = :%1:sFilter ) '''', [Field, FieldName]);
fdMatchRange :
begin
if StartingValue <> '''''''' then
Result := Result + Format(''''%0:s >= :%1:sStart)'''', [Field, FieldName]);
if (StartingValue <> '''''''') and (EndingValue <> '''''''') then
Result := Result + '''' and ('''';
if EndingValue <> '''''''' then
Result := Result + Format(''''%0:s <= :%1:sEnd)'''', [Field, FieldName]);
end;
end
else
case MatchType of
fdMatchStart:
Result := Result + Format(''''UPPER(%0:s) starting with :%1:sFilter ) '''', [Field, FieldName]); {do not localize}
fdMatchAny:
Result := Result + Format(''''UPPER(%0:s) containing :%1:sFilter ) '''', [Field, FieldName]); {do not localize}
fdMatchEnd :
Result := Result + Format(''''UPPER(%0:s) like :%1:sFilter ) '''', [Field, FieldName]); {do not localize}
fdMatchExact :
Result := Result + Format(''''UPPER(%0:s) = :%1:sFilter ) '''', [Field, FieldName]); {do not localize}
fdMatchRange :
begin
if FieldType = ftString then
begin
if StartingValue <> '''''''' then
Result := Result + Format(''''UPPER(%0:s) >= :%1:sStart)'''', [Field, FieldName]); {do not localize}
if (StartingValue <> '''''''') and (EndingValue <> '''''''') then
Result := Result + '''' and (''''; {do not localize}
if EndingValue <> '''''''' then
Result := Result + Format(''''UPPER(%0:s) <= :%1:sEnd)'''', [Field, FieldName]); {do not localize}
end
else
begin
if StartingValue <> '''''''' then
Result := Result + Format(''''%0:s >= :%1:sStart)'''', [Field, FieldName]); {do not localize}
if (StartingValue <> '''''''') and (EndingValue <> '''''''') then
Result := Result + '''' and (''''; {do not localize}
if EndingValue <> '''''''' then
Result := Result + Format(''''%0:s <= :%1:sEnd)'''', [Field, FieldName]); {do not localize}
end
end;
end;
end
else
case MatchType of
fdMatchRange :
begin
if StartingValue <> '''''''' then
Result := Result + Format(''''%0:s >= :%1:sStart)'''', [Field, FieldName]); {do not localize}
if (StartingValue <> '''''''') and (EndingValue <> '''''''') then
Result := Result + '''' and (''''; {do not localize}
if EndingValue <> '''''''' then
Result := Result + Format(''' 上一页 [1] [2] [3] 下一页 没有相关教程
|