startdate=Convert.ToDateTime(row.Item(0).ToString) i did this to capture dates from my excel table but its saying ToDateTime is not a member of date however the variable startdate is of type Date/Time help please
Fine
May i know what is the value of row(0) from your excel
to know that put that in WRITELINE ACTIVITY so that we could know the date format we get from the excel based on which we can write the expression here
Cheers @Taimur
TPV Date sorry its row(5) in the above expression
startdate=Convert.ToDateTime(row.Item(5).ToString)
basically i have copied this flow from another main file in which the above expression was working fine but when copied its giving these errors.
Fine
mention this row.Item(5).ToString in writeline activity and kindly share us the screenshot of the output in the output panel
Cheers @Taimur
this is what i get. Its a different file with the same format of what i have shared earlier dont get confused with the date the output is ok cheers !
@Taimur Please find the attachment.
i have tried to extract date in MMM dd , yyyy format. you can change accordingly whichever format you want.
Date.xlsx (7.9 KB)
DateTimeConversion.xaml (6.4 KB)
Regards,
Ahtesham
much appreciated ahtesham but the real problem is after writing Convert. “its not giving me the option for DateTime” i have copied a flow from one main file to another would that be causing the problem ?
@Taimur, with convert it will not give option for DateTime instead it will give option as ToDateTime.
Please find below
i have used your piece of snippet/Code to fetch the value and it works fine without giving any error…
No, it is not at all because of copying from one flow to another.
If you are still blocked , please let me know. ? Please provide the exact output of date you are looking for.
Ahtesham
Fine
kindly try with this expression
startdate = DateTime.ParseExact(row(5).ToString.SubString(0,10),“MM/dd/yyyy”,system.globalization.cultureinfo.invariantculture)
where startdate is a variable of type datetime
Cheers @Taimur
to be honest this expression: row.Item(0) is already of the DateTime type, you do not need to convert it…
Thankyou everyone somehow its now working would not be possible without you guys cheers
Awesome
Cheers @Taimur