What is the difference between Boolean ? and Boolean

Hi All

I am getting below error.
Boolean error

Am curious to know what is the difference ?

@Palaniyappan @lakshman @vvaidya @supermanPunch

1 Like

HI @kkpatel

Can you share the data type of mydated?

Regards
Sudharsan

Hi @kkpatel

Can you explain your query little bit?

And also tell us the mydate value

Regards
Gokul

@kkpatel

It’s better if you share the values of the variable and also screenshot of your workflow?

Thanks

Hi @kkpatel ,

The Difference between bool? and bool types is that

  1. Bool can have two values - True or False
  2. Bool? can have three values - True, False or Null

But if we have to figure out the issue with your case, we would require you to provide some more details as to what you’re trying to perform

1 Like

@supermanPunch @Gokul001 @Sudharsan_Ka @Srini84

I am trying to check if a date value is 30 days lesser than today’s date.

The data type of mydated is Nullable. If I make it simple DateTime there is no error.

Maybe try it as shown in image

Fine

Usually the ? symbol after a type is only a shortcut to the nullable type, bool? is equivalent to Nullable<bool> .

bool is a value type, this means that it cannot be null , so the Nullable type basically allows you to wrap value types, and being able to assign null to them.

bool? can contain three different values: true , false and null .

Also, there are no short-circuiting operators (&& ||) defined for bool?

Here in your expression you have mentioned as Today.AddDays(-40)=mydated

Since you need a non-nullable Boolean expression, write like this

mydated < Now.AddDays(-30)

Make sure mydated is also a Datetime variable

Cheers @kkpatel