Ver Mensaje Individual
  #22  
Antiguo 27-10-2008
lKinGl lKinGl is offline
Miembro
 
Registrado: ago 2007
Posts: 333
Reputación: 20
lKinGl Va por buen camino
Talking

Salu2,

gracias al código de caro he podido hacer unas modificaciones y adaptaciones algo engorrosas pero que cumplen exactamente con lo que quiero.... esto fue lo que hice

Combobox1 agregando en Items Enero, Febrero, MArzo, Abril, Mayo, Junio, Julio.....Diciembre

Combobox2 Agregando en Items 2008...2015

1 Edit (Aqui se muestra la fecha).

un boton aceptar que saca el calculo de la fecha y el quick report

Código del Botón
Código Delphi [-]
//Declaro las variables mes y año de tipo String
edit1.visible:=false;
if ComboBox1.Text='Enero' then
  begin
    mes:='01';
  end;
if ComboBox1.Text='Febrero' then
  begin
    mes:='02';
  end;
if ComboBox1.Text='Marzo' then
  begin
    mes:='03';
  end;
if ComboBox1.Text='Abril' then
  begin
    mes:='04';
  end;
if ComboBox1.Text='Mayo' then
  begin
    mes:='05';
  end;
if ComboBox1.Text='Junio' then
  begin
    mes:='06';
  end;
if ComboBox1.Text='Julio' then
  begin
    mes:='07';
  end;
if ComboBox1.Text='Agosto' then
  begin
    mes:='08';
  end;
if ComboBox1.Text='Septiembre' then
  begin
    mes:='09';
  end;
if ComboBox1.Text='Octubre' then
  begin
    mes:='10';
  end;
if ComboBox1.Text='Noviembre' then
  begin
    mes:='11';
  end;
if ComboBox1.Text='Diciembre' then
  begin
    mes:='12'
  end;

ano:=ComboBox2.Text;
edit1.Text:='01'+'/'+mes+'/'+ano;

with Form45.Query1 do begin
   Close;
   SQL.Text := 'Select Fecha,grupo,des_cu,debe,haber '+
             'from costosygastos.db '+
             'where Extract(month from fecha) = '+IntToStr(MonthOf(StrToDate(Edit1.Text)))+
             ' and Extract(year from fecha) = '+IntToStr(YearOf(StrToDate(Edit1.Text)));
   Open;
end;
form45.QuickRep1.Preview;

de esa forma funciona como quiero gracias por su ayuda amigos, ha sido de mucha utilidad
__________________
Las cosas o son, o no son...
Responder Con Cita