I have a column in the DateCreated database that shows the creation date. Now I want to filter records based on the selected date range. For instance:
- created in 60 days
- created within a month
- etc...
I have a DateCreated variable that shows me what the user has selected as a range, i.e. whether it was created within 60 days created during the year, etc.
DateTime CurrTime = DateTime.Now; if (Program.DateCreated <= DateTime.Now - 60) {
But the above code will not work. What will be the syntax for getting records in a certain range?
source share