I have a query that is calling an Oracle DB from C#. I want to write the query to get data that is, at most, 5 years old.
I currently have a hard coded value for public const int FIVE_YEARS_IN_DAYS = 1825;
But, this isn't correct because of leap years. Is there a function that will give me the correct number of days in the preceeding 5 years?
I think you want this:
DateTime now = DateTime.Now;
now.AddYears(-5).Subtract( now ).Days
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With