I want all records that are within the allowed dates.
SELECT
page_id, page_published_date, page_expired
FROM
pages
WHERE
([page_published_date] <= getdate() OR [page_published_date] is null)
AND
([csp_expired] <= getdate() OR [page_expired] is null)
Mind that dates can contain null values.
Example table:
page_id, page_published_date, page_expired
1 2012-10-05 null
2 null 2012-10-01
3 2012-08-01 2012-11-30
In this case the correct record would be 3.
Edited answer, based on choosing #3 as the only result
Direct translation from subject line
Notes:
DateDiff(D,0,getdate())gives you “today”, i.e. without the time portion