Delphi - AYUDA CON SELECT

 
Vista:

AYUDA CON SELECT

Publicado por many (37 intervenciones) el 19/12/2018 23:36:01
Saludo a todos y gracias adelantada

Necesito el favor de ustedes para integrar otro campo a esta búsqueda que funciona bien entre dos fechas, pero quiero que también filtre por un campo que tengo llamado concepto.

Ayúdenme a que haga la búsqueda por tres campos: desde,hasta y otro que se llamara concepto.

1
2
3
4
5
6
7
DM.sqlingresos.SQL.Clear;
DM.sqlingresos.SQL.Add('Select *');
DM.sqlingresos.SQL.Add('From INGRESOS');
DM.sqlingresos.SQL.Add('Where FECHA Between :FechaIni and :FechaFin');
DM.sqlingresos.Parameters.ParamByName('FechaIni').Value := desde.Date;
DM.sqlingresos.Parameters.ParamByName('FechaFin').Value := hasta.Date;
DM.sqlingresos.Open;

Gracias a todos.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 65
Oro
Ha mantenido su posición en Delphi (en relación al último mes)
Gráfica de Delphi

AYUDA CON SELECT

Publicado por E.T. (1244 intervenciones) el 19/12/2018 23:59:14
Es cuestion de agregar un parámetro más

1
2
3
4
5
6
7
8
DM.sqlingresos.SQL.Clear;
DM.sqlingresos.SQL.Add('Select *');
DM.sqlingresos.SQL.Add('From INGRESOS');
DM.sqlingresos.SQL.Add('Where FECHA Between :FechaIni and :FechaFin');
DM.sqlingresos.SQL.Add('and concepto = ' + QuotedStr(variableConcepto));
DM.sqlingresos.Parameters.ParamByName('FechaIni').Value := desde.Date;
DM.sqlingresos.Parameters.ParamByName('FechaFin').Value := hasta.Date;
DM.sqlingresos.Open;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

AYUDA CON SELECT

Publicado por many (37 intervenciones) el 20/12/2018 15:02:40
Buenos días y gracias a todos por ayudar una ves mas.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar