I guess you mean "how do I select records from a database that have a date field containing a date of not more than 30 days ago"
in mysql:
SELECT * FROM mytable WHERE date_field>date_sub(now(),interval 30 day);
the "day" is not a typo, it has to be singular.
Check out the MySQL manual for more information about dates and date caculations.