I have a database with event information, including date (in MMDDYYYY format). is it possible to write an SQL Server statement to only get rows that fall within a certain time frame?
something like this pseudo-statement:
SELECT * FROM events WHERE [current_date minus date <= 31] ORDER BY date ASC
where date
is the date in the SQL Server row and current_date
is today's date. The 31
is days, so basically a month's time.
I can easily process the data after a generic statement (read: SELECT * FROM events ORDER BY date ASC
), but it would be "cool" (as in me learning something new :P) to know if this is possible.