Get a record with a specific date range.

Get a record with a specific date range.

Hi,
I want to get records of a specific month and year by adding the date to a date field and I can not do to work. I have tried several ways and I do not get it to work, it does not filter me the data.


 .This is my code;



str=input.Mes;   /// Is a date field///
mes_1=str.getMonth();
mes_2=str.getYear();


mes_12=mes_2.toString();
mes_3=mes_1.toString();



Moneda_prueba = Gastos.sum(Monto);