Dears,
Based on Some inputs in Excel : Month, Day, and Year as strings, I want to get the Complete Date Format as follows : MM/DD/YYYY
Dears,
Based on Some inputs in Excel : Month, Day, and Year as strings, I want to get the Complete Date Format as follows : MM/DD/YYYY
Hi.
Take a look at some online sources, such as this one: DateTime Constructor (System) | Microsoft Learn
I think you just need to construct the date with each value.
Let’s assume you use an Excel Read Range and a ForEach to process each row. It might look like this:
For each row in dt1
Assign activity: row("Date") = (new DateTime(CInt(row("Year").ToString),CInt(row("Month").ToString),CInt(row("Day").ToString))).ToString("MM/dd/yyyy")
Excel Write Range
Note: I didn’t test this.
The part of .ToString(“MM/dd/yyyy”) is just so you can format it the way you want and uses similar formatting as you see in Excel Format Cell options.
I hope this helps.
Regards.
Thanks Jyotika. Well Done
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.