Get date from an excel coulumn


#1

When i am extracting the date from an excel using row(column index).ToString Sometimes i am getting date and time while sometimes only date.I need the date only.Pls help me!


Excel date format to message box
#2

row(column index).ToString(“dd-MM-yyyy”)


#3

option strict on disallows implicit conversion from ‘String’ to ‘Integer’
@ddpadil this is the error being shown when i do this


#4

Convert.ToInt32(“varaible”)


#5

its showing the same error again


#6

attach workflow.


#7

Main.xaml (7.6 KB)


#8

your workflow doesn’t have all the details/variable. so can’t analyse properly. anyway you can do this.
please use get row item activity to get the values .
later create **output variable (x)**to it and use the above code to get only date format.
x.ToString(“dd-MM-yyyy”)


#9

thanks bro now its working


#10

Hi ddpadil, have same issue and tried same as you have mentioned below, Sharing screens and attaching the workflow as well, ThanksMain.xaml (26.2 KB)

getdate

Convert


#11

Hi @hkjobs1988

Fist assign the Converted_Time Variable of type (system.DateTime)=DateTime.ParseExact("04/26/2016", “MM/dd/yyyy”,
CultureInfo.InvariantCulture)
sidenote: As I’m not sure about date column in the excel your using :wink: . In the place of 04/26/2016 pass your get row activity output variable and make sure to match the format of it to date you receive from excel column.
Then get your date format by declaring Converted_Time.ToString(“dd/MM/yy”)
Imported “System.Globalization” namespace

Check now.
Main (17).xaml (26.7 KB)


#12

ddpadil

many thank you for response ,tried the flow you had shared same error, I am attaching the excel i am using.
what i have noticed is ,flow is stopping at get row it self , compiler is not reaching to Assign activity.
InputClaimsData.xlsx (10.0 KB)


#13

Hi,
Done.:+1:
Check now.
Main (19).xaml (26.6 KB)


#14

hi @ddpadil tried to get only year, please suggest


#15

Sure .Format of date field?
Can we have any excel for the reference .


#16

Hi ddpadil,

Need your small help i have an excel and in that there is a date column i hvae date in thta column and the datatype is also date i have checked using formal cell and check that the datatype is date but i want that date column to convert into string type i tried various ways but failed to do so.