![]() |
|
|
|
|
#1
|
||||
|
||||
|
Есть таблица с полем где числа 1 , 2 ,3 ,4 ,5 ,6, 7, 8, 9, 10.
В БдЛукАпКомбобокс1 я выбираю число 2 в Дблуукапкомбобок2 число 5 какой запрос будет чтобы в ДБгрид выводилось данные от 2 до 5 (2,3,4,5) ![]() |
|
#2
|
||||
|
||||
|
Код:
AdoQuery1.SQL.Text := Format('select * from YouTable where YouField in %d..%d',[Value1,Value2]);
AdoQuery1.Open;Код:
AdoQuery1.SQL.Text := 'select * from YouTable where YouField between :Value1 and :Value2'; AdoQuery1.Parameters.ParamValue['Value1'] := Value1; AdoQuery1.Parameters.ParamValue['Value2'] := Value2; AdoQuery1.Open; |
|
#3
|
||||
|
||||
|
Код:
Query1.Sql.Clear;
Query1.Sql.add('Select * from Itog where Den between: Edit4.text and edit5.text);
Query1.Active:=true;Код:
:Value1 and :Value2'; |
|
#4
|
||||
|
||||
|
Не так. Раз у вас не ADO а BDE то так:
Код:
Query1.Sql.Clear;
Query1.Sql.add('Select * from Itog where Den between :Value1 and :Value2');
Query1.Params.ParamValues['Value1'] := Edit4.text;
Query1.Params.ParamValues['Value2'] := Edit5.text;
Query1.Open; |
|
#5
|
||||
|
||||
|
Цитата:
|
|
#6
|
||||
|
||||
|
Поле Den какого типа?
|