David Smith

David Smith

  • NA
  • 2k
  • 0

c# DateTime Diff

Oct 5 2010 11:05 PM
Can someone assist me with a datetime diff situation. Im trying to figure the logic out for this.

basically im trying to compare records baseoff of a datetime, from two different tables.  The datetime is slightly off by  plus or minus 3mins.

below you will notice a 3min difference.  I want to be able to say

  //plus or minus 3minutes via datetime
   EList elTestInfoList = EList .Where(d => d.EL_OpTimeStamp  "is plus or minus 3mins"   SystemRecord.DateTime);
 
    if both datetimes are plus or minus three minutes from each other, I want to do something. so how do you set up the logic or linq  for this situation


              table  1

              datetime  ,                              field  A,    field  B,     etc............

row 1:    12/6/2007 7:00:00 AM,                       


table  2                                            
                                                          
               datetime  ,                            field  A,    field  B,     etc............

Row 1:  12/6/2007 7:03:00 AM,         field A ,    field  B ,    etc....

Answers (4)