Conversion from String "" to type 'Date' is not valid

Hi,

I have this error as seen in screenshot. “Conversion from String “” to type ‘Date’ is not valid”

2

Please advise where do I check to resolve the issue.

Thank you

Make sure InvDate of type DateTime and use this instead

DateTime.ParseExact(row.item,“dd/MM/yyyy”,nothing)

If it doesn’t work, use DateTime.ParseExact(row.item.Trim,“dd/MM/yyyy”,nothing) incase row.item has extra spaces

Hope it helps

Hi thanks for your reply, may I know where do you suggest I put " DateTime.ParseExact(row.item,“dd/MM/yyyy”,nothing)" ?

Thank you!

Convert.ToDateTime(Row.Item(“Birthaday Date”).ToString)

it will work use this

Hi,

I did the solution you gave and then this error prompts.

Please advise.

Thank you.

This not work
image

Hi,
Try to use this: Date.ParseExact(TempDate.ToString, “dd.MM.yyyy”, System.Globalization.DateTimeFormatInfo.InvariantInfo)

Where: Date.ParseExact(You date at strind, “format you date”, System.Globalization.DateTimeFormatInfo.InvariantInfo)

Buddy Change the Variable type as DateTime

an empty string cannot be parsed into a datetime
Data requires to ge cleansed before or to define a default datetime representing the empty date string e.g. 01.01.1900 or 09.09.9999

Where is “row” coming from? Are you doing a For Each Row? Show us how that activity is set up.