Structure "Integer" cannot be indexed

Hi all,

I am trying to use DateDiff here ,


GapInMonths variable is of type Int32 , and both PromotionGap and PayrollEffectiveDate are of type Date.
But instead of getting Integer from DateDiff , i am getting this error

What should i do ?

@P-A-J

Gives you the output as integer why you are making it again Cint

DateDiff(DateInterval.Day,Date1,Date2)

Cheers

Hi @P-A-J ,

Could you try changing the Datatype of GapInMonths from Int32 to Int64 and check ?
image

Also the Conversion using CInt() would not be needed.

We would recommend doing the changes as suggested by @supermanPunch. We also encountered some scenarios where a correct statement (e.g. after corrections) was not accepted by the compiler. Here we deleted it / remodelled it and retyped the correct statement again. After this action it was accepted by the compiler

It worked , but i didnt understand why Int64 ?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.