Dayofthemonth, dayoftheweek y un query.
Saludo gente,
Tengo el siguiente problema: hice un query que realiza una consulta ordenadas por fechas, pero al sacarle los días de la semana y el día del mes, no efectúa nada, lo dividí en tres RadioButtons, el primero como ha de esperarse lo hace, pero con los otros dos no, por qué sera? Este es el código: Código Delphi [-] procedure TForm2.Query(Campo1: String;Campo2: String); Const Consulta ='SELECT Fecha,%s FROM Tabla WHERE (%s IS NOT NULL) AND (Campo1 = %s) AND (Fecha BETWEEN :Fec1 AND :Fec2) ORDER BY Fecha'; Var FechaQ:=TDate; begin Query1.Close; Query1.SQL.Clear; Query1.SQL.Text:=Format(Consulta,[Campo2,Campo2,QuotedSTr(Campo1)]); Query1.ParamByName('Fec1').asDate := DateTimePicker1.Date; Query1.ParamByName('Fec2').asDate := DateTimePicker2.Date; Query1.RequestLive := true; Query1.Open; Query1.First; while Not Query1.Eof do begin FechaQ:=Query1.FieldByName('Fecha').AsDateTime; if RadioButton1.Checked = True then begin Arreglo[Contador1]:=StrtoInt(Query1.FieldByName(Campo1).AsString); Contador1:=Contador1+1; end; if RadioButton2.Checked = True then if StrtoInt(Edit1.Text) = dayofthemonth(FechaQ) then Begin ArregloTriple[Contador1]:=StrtoInt(Query1.FieldByName(Campo1).AsString); Contador1:=Contador1+1; end; if RadioButton3.Checked = True then if ComboBox1.ItemIndex = dayoftheweek(FechaQ) then Begin ArregloTriple[Contador1]:=StrtoInt(Query1.FieldByName(Campo1).AsString); Contador1:=Contador1+1; end; Query1.Next; end; end; Ah! Y les comento que mi tabla es Paradox. Mil gracias!!!!!!! |
Ya Resuelto!!!!!!!!!!!!!!!!11
Ya lo resolvi!!!!!!!!!!!!!!!1
Era un problema en otro modulo, había colocado un condicional con el radiobutton1 anteriormente, disculpen las molestias ocasionadas :p |
La franja horaria es GMT +2. Ahora son las 22:21:06. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi