here dateformat is the datatable of read range
DateTime.ParseExact(CurrentRow("Vehicle Unloaded Date").ToString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("MMMM")
Regards
the other values are also there in the column like blanks and NA but it should change only the dates.how to set that condition
Book1.xlsx (1.4 MB)
the dates in these 2 columns should be converted into month
convert.ToDateTime(“StringDate”).ToString(“MMMM”) use this format to get only month from date
but the condition is date is in string format
there are other values also in the column it should capture only date
month and year also should get
Handle in IF Condition:
IF it matches the date format: returns Month Name Else: Invalid Date
Use Assign Activity for below expression:
If(DateTime.TryParseExact(dateString, “dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing),DateTime.ParseExact(dateString,“dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMMM”),“Invalid Date”)
Hope it will helps you
month and year both should get
@anjani_priya
Month and Year like
Like this : April 2024 ?
yes. in this format.
you can try this
convert.ToDateTime(“StringDateVariable”).ToString(“MMMM-yyyy”) use this format to get only month from date
but the condition is date is in string format
Try this:
Forum.zip (2.1 KB)