Skip to content

Filters with >= or <= #528

Answered by Mimetis
maxrodro asked this question in Q&A
Discussion options

You must be logged in to vote

Because your comparison is >=, you need to use the AddCustomWhere method, like this:

(I take ProductCategory as my table and I want to create a filter on column ModifiedDate)

var setup = new SyncSetup(new string[] { "ProductCategory" });

// Create a filter on table ProductCategory 
var productCategoryFilter = new SetupFilter("ProductCategory");
// Parameter ModifiedDate mapped to the ModifiedDate column
// Allow Null = true
productCategoryFilter.AddParameter("ModifiedDate", "ProductCategory", true);
// Since we are using a >= in the query, we should use a custom where
productCategoryFilter.AddCustomWhere("base.ModifiedDate >= @ModifiedDate Or @ModifiedDate Is Null");

The generated SQL wi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by maxrodro
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants