FieldLikePredicate

Posts   
 
    
ztron
User
Posts: 13
Joined: 30-Mar-2012
# Posted on: 19-May-2020 09:04:04   

Hi,

I am looking generate code that will produce sql like:

[name] NOT like 'P%'

I do use CustomerFields.Name % "P%" to generate:

[name] like 'P%'

but is there a reversal operator to go with or replace the '%'?

Ron.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39589
Joined: 17-Aug-2003
# Posted on: 19-May-2020 10:34:16   
var p = Functions.Not(CustomerFields.CompanyName.StartsWith("P");

or

var p = Functions.Not(CustomerFields.CompanyName.Like("P%");

You have to include the namespace SD.LLBLGen.Pro.QuerySpec

Or

var p = CustomerFields.CompanyName % "P%";
p.Negate=true;

Frans Bouma | Lead developer LLBLGen Pro