Hi! I have variable A and B with the same format = Datetime.parseexact(row(0).ToString,“yyyyMMdd”,system.globalization.cultureinfo.invariantculture).tostring(“dd-MM-yyyy”)
How can i substract? i receive error message like “substract its not member of sting”…i try some possibilites but without sucess
Check this below code, @Pedro_Santos
(Date.ParseExact(Date.ParseExact(“20211212”,“yyyyMMdd”,System.Globalization.Cultureinfo.Invariantculture).ToString(“dd-MM-yyyy”),“dd-MM-yyyy”,System.Globalization.Cultureinfo.Invariantculture) - Date.ParseExact(Date.ParseExact(“20211128”,“yyyyMMdd”,System.Globalization.Cultureinfo.Invariantculture).ToString(“dd-MM-yyyy”),“dd-MM-yyyy”,System.Globalization.Cultureinfo.Invariantculture)).TotalDays
Hope this may help you