String to datetime RRS feed

  • Question

  • Hi all,

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

    return Set().FirstOrDefault(x=>;

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

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

    2. sort on myrank (and return first row)


    Tuesday, February 5, 2013 12:18 AM


  • 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 => >= convert.todatetime(datetimestring)).Max(datum=>datum.myrank)

    - Prashant

    Tuesday, February 5, 2013 7:23 AM