Server DateTime.AddDays()

12 posts, 0 answers
  1. Chris Williams
    Chris Williams avatar
    63 posts
    Member since:
    Oct 2004

    Posted 13 Dec 2009 Link to this post

    Hi, I know it's not implemented, but I just wanted to let you know I ran into this limitation so that you can prioritize it for implementation in the future.  I'll implement on the client for now.

    Execution of 'System.DateTime:AddHours(Double)' on the database server side currently not implemented.

    In the linq query:
                var accounts = from a in Scope.Extent<Account>()
                               where a.LastTransaction < DateTime.Now.AddHours(-6) && !string.IsNullOrEmpty(a.Password)
                               select a;
                return accounts;



  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 14 Dec 2009 Link to this post

    Hello Chris Williams,

    We are aware of the problem, it is already on our TODO list. As per your request, we will raise the priority. Thank you for the vote.

    Regards,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Markus
    Markus avatar
    205 posts
    Member since:
    Nov 2005

    Posted 30 Dec 2009 Link to this post

    Same here.

    Vote for it :-)

    Regards Markus
  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 30 Dec 2009 Link to this post

    Hi Markus Berchtold,

     we got your request...

    Meanwhile, you can just calculate the resulting value on the client side and use this value as a parameter (removing the calculation from the LINQ query):

    var later = DateTime.Now.AddHours(-6);

    var accounts = from a in Scope.Extent<Account>()
    where a.LastTransaction < later && !string.IsNullOrEmpty(a.Password)
    select a;
    return accounts; 

    Best Regards,

    Thomas
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 26 Apr 2010 Link to this post

    Is this feature in yet?...I mean for the next release
  7. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 28 Apr 2010 Link to this post

    Hello Steve,

    at the moment this is not pushed yet. We've implemented the Date property however, so we could do something like

    from x in Persons where x.Birthday.Date >= new Date(x.Marriage.Year-18, x.Marriage.Month, x.Day) select x; 

    to find all Persons that married before they were 18.

    I have filed an entry for such a feature.

    Sincerely yours,
    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 28 Apr 2010 Link to this post

    When you do impliment it, can you also add in .ToString("<date format>") please?
  9. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 29 Apr 2010 Link to this post

    Hello Steve,

    hmm, I would be willing to support DateTime.ToString() to invoke the default behavior in the server, but I'm not convinced yet that ToString("complicated fomat") should be pushable to the server. At the end, we need to consider database systems specifics here. 

    Regards,
    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 30 Apr 2010 Link to this post

    Ok thanks, the need was to check a date string against a search value passed in...so if the user searched for Wednesday or Wed I was wanting to match that...
  11. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 03 May 2010 Link to this post

    Hello Steve,

    so at the end is it more about supporting a way to express the DateTime.DayOfWeek property?
    What else is required?

    Sincerely yours,
    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  12. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 03 May 2010 Link to this post

    Well more about allowing a freeform search of any date value...so I wanted to open the DateTime up to a full string date format (so Sunday, January, Dec, December, etc etc)...I have users who see\use dates differently (lots of nationalities)
  13. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 03 May 2010 Link to this post

    Hello Steve,

    I'm not really convinced that this is a fantastic idea: I'm from Germany and would write Dezember so no 'american english speaking' database server  would give me the right answer in this case, as all would return some form of dec, Dec, December etc.. 
    In this case, a DateTime.DayOfWeek == System.DayOfWeek.Tuesday seems preferrable to me.

    Greetings,
    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner