|
codigo de la consulta
esta es la consulta que ejecuto
procedure TForm1.Button3Click(Sender: TObject);
begin
inicio:=formatdatetime('DD/MM/YYYY',FECHAI.Date);
fin:=formatdatetime('DD/MM/YYYY',FECHAf.Date);
fecha.Text:=inicio;
caliz.Text:=fin;
query1.Close;
query1.SQL.Clear;
// query1.SQL.Text:='select numparte,descripcion,unidad,precio,promedio,existencias,nivel_minimo,nivel_maximo,localizacion,fecha from materiales where FECHA = #'+datetostr(Fechai.date)+'#';
query1.SQL.Text:='select numparte,descripcion,unidad,precio,promedio,existencias,nivel_minimo,nivel_maximo,localizacion,fecha from materiales where FECHA between #'+datetostr(Fechai.date)+'# and #'+datetostr(Fechaf.date)+'#' ;
//query1.SQL.Text:='select numparte,descripcion,unidad,precio,promedio,existencias,nivel_minimo,nivel_maximo,localizacion,fecha from materiales where FECHA between #'+datetostr(Fechai.date)+'# and #'+datetostr(Fechaf.date)+'# ';
//query1.SQL.Text:='select numparte,descripcion,unidad,precio,promedio,existencias,nivel_minimo,nivel_maximo,localizacion,fecha from materiales where FECHA between '+inicio+' and '+fin+'' ;
// query1.SQL.Text:='select numparte,descripcion,unidad,precio,promedio,existencias,nivel_minimo,nivel_maximo,localizacion,fecha from materiales where FECHA between '+#39+FECHAI.Date+#39+' and'+#39+FECHAf.Date+#39' ;
showmessage(query1.SQL.Text);
query1.Active:=true;
end;
|