How to convert Generic value to date?

Hi,
I am reading excel file and using lookup data table getting column value one by one and storing those value the column has date value to once I am storing into string or date datatype variable its giving error, but if I am storing into generic variable then I am able to store the value.

please suggest me how store the value directly into date datatype variable or suggest me how to convert generic value to date datatype without timestamp (should be only date not time).

Thanks,
A. Nadeem

@akhtar.nadeem ,

Could you try the below Expression :

CDate(yourGenericVariable.ToString).Date

Also, Let us know what is the format of the Date value that you will receive.

Thank you @supermanPunch
It is working I made it string and got only date value by using this code
(CDate(gvServiceDate.ToString).Date).ToString(“MM-dd-yyyy”)

Thank you very much.

1 Like

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