none
String to datetime RRS feed

  • Question

  • Hi all,

    I have a function returns context.set() as below

    return Set().FirstOrDefault(x=>x.id==id);

    the set contains {id, myrank, datetimestring}, how can I do

    1. do a datetime.today >= convert.todatetime(datetimestring) in C#/tsql

    2. sort on myrank (and return first row)

    TIA

    Tuesday, February 5, 2013 12:18 AM

Answers

  • Can you put more details to help us understand, if you just needs sets with two conditions you have asked for,

    then you can try following:

    .Where(datum => datetime.today >= convert.todatetime(datetimestring)).Max(datum=>datum.myrank)


    - Prashant http://prashantsblogs.wordpress.com http://prashantsblogs-algos.blogspot.in

    Tuesday, February 5, 2013 7:23 AM