I am geting resultset for last 10,20 days. But resultset is null for last 15,30 and >30 days.
There's nothing wrong with the SQL; the problem probably has something to do with data types and type conversions. That would depend on the table definition in the database and the Java code.