Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7902697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:34:14+00:00 2026-06-03T09:34:14+00:00

I need to perform a delta select on a table (return only records that

  • 0

I need to perform a delta select on a table (return only records that have changed, since a certain TimeStamp), and I must use a TimeStamp column. In SQL, this is easy:

@DeltaStamp TIMESTAMP

...

select *
from table
where timestamp > @DeltaStamp

In Linq2SQL I can get the max timestamp easily:

var maxStamp = MyTable
.OrderByDescending(x => x.TimeStamp)
.Take(1)
.FirstOrDefault().TimeStamp;

But How can I perform the delta query?

var newRecords = MyTable
.Where(x => x.TimeStamp > maxStamp);

This doesn’t compile with:

Operator '>' cannot be applied to operands of type 
'System.Data.Linq.Binary' and 'System.Data.Linq.Binary'

Cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:34:16+00:00Added an answer on June 3, 2026 at 9:34 am

    This is not possible in L2S. A SQL Timestamp column is not a dateTime column. It is a binary, and L2S treats it as such. Therefore, you are unable to do what you want to do, at least not “out of the box”. You could create your own Comparer as follows:

    public static class BinaryComparer
    {
     public static int Compare(this Binary v1, Binary v2)
     {
     throw new NotImplementedException();
     }
    }
    
    var result = from row in MyTable
                 where BinaryComparer.Compare(row.TimeStamp, SomeTarget) > 0
                 select row;
    

    This should work, or be close.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to perform normalization on data structure. I have one table with lots
I need to perform an action after a session times out. However I have
I need to perform a JOIN on a JOIN-ed table, and I'm not sure
I need to perform queries in a ADO.NET model by using LINQ. I have
I need to perform send photo functionality. I have a web service method which
I need to perform some actions when list box selection is about to changed,
I need to perform http PUT operations from python Which libraries have been proven
I need to perform some atomic arithmetic in Rails but the only way I've
I need to perform a pivot on an XML column in a table, where
I need to perform a calculation in SSAS which only applies to the current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.