First of all your database table should have a date field which captures the date of transaction.
If your database is SQL Server use the query below
select * from tablename
where datefield > dateadd(mm,-3,getdate())
if oracle then use
select * from tablename
where datefield > sysdate-30