Ver Mensaje Individual
  #18  
Antiguo 27-02-2008
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Reputación: 25
egostar Va camino a la fama
Cita:
Empezado por javimax182 Ver Mensaje
Lo que yo quiero es que filtre por las ventas que se hicieron en el mes actual.
Por ejemplo: si hoy seria 7 de mayo. Me tendria que filtrar todas las ventas que se hicieron del 1 de mayo hasta el 7 de mayo.

Pero que aga todo eso sin que el usuario tenga que ingresar nada ni seleccionar nada.
Sabes como?. Gracias
Ya, ahora entiendo, puedes hacer esto

Código Delphi [-]
procedure TForm1.BitBtn1Click(Sender: TObject);
var
  Year, Month, Day, Hour, Min, Sec, MSec: Word;
begin
  Query1.Close;
  DecodeDate(Now, Year, Month, Day);
  Query.sql.clear;
  Query.sql.add('select * from Ventas where EXTRACT(MONTH FROM fecha_ventas) = :mes');
  Query1.ParamByName('mes').AsInteger := Month;
  Query1.Open;
end;

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita