Select Dates within a period of days
-
Hello needs some help with this one: I have a 384 days of rates a rate price and date. I am trying to fill a graph by day of rates. I am allowing the user to select 30, 60 or 90 days of rates within a start and end date of choosing. I am trying to use linq to return only 30, 60 or 90 days of rates based on the start and end dates. The issue is the start and end date range could be less then let's say 30 days so I still want to return 30 days of rates. I have not been very successful. Thanks so much for the help.
-
Hello needs some help with this one: I have a 384 days of rates a rate price and date. I am trying to fill a graph by day of rates. I am allowing the user to select 30, 60 or 90 days of rates within a start and end date of choosing. I am trying to use linq to return only 30, 60 or 90 days of rates based on the start and end dates. The issue is the start and end date range could be less then let's say 30 days so I still want to return 30 days of rates. I have not been very successful. Thanks so much for the help.
And without showing your query code, there is very little anyone can do to help you.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Hello needs some help with this one: I have a 384 days of rates a rate price and date. I am trying to fill a graph by day of rates. I am allowing the user to select 30, 60 or 90 days of rates within a start and end date of choosing. I am trying to use linq to return only 30, 60 or 90 days of rates based on the start and end dates. The issue is the start and end date range could be less then let's say 30 days so I still want to return 30 days of rates. I have not been very successful. Thanks so much for the help.
You will need to adjust the start, or end, dates before making your query. If the start date is outside the range of the available data-days: 1. if it's before the first day, then return #n data-days beginning on the first day ... or return an error. 2. if it's after the last day, then return the last #n data-days from the data ... or throw an error. 3. if the start date is in the valid range, but the user wants more data-days than are possible, decrease the start date so you can return the required data-days data. You don't specify how exactly, given valid start and end dates you let the user choose which 30,60,90 day chunk to return, so can't comment on that.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009