Book1.xlsx (1.2 MB)
this is the data
can you help me with how to change the date 01-01-2023 into month january
try this for your input it will work
Dim startDate As New DateTime(2023, 12, 1)
Dim endDate As New DateTime(2023, 12, 31)
Dim DateModify As String
Dim AcknowledgmentModify As String
For Each r As DataRow In in_dt.AsEnumerable()
If(Not r("Date").ToString.Equals("") And Not r("Acknowledgement").ToString.Equals(""))Then
If(Not r("Date").ToString.Equals("NA") And Not r("Acknowledgement").ToString.Equals("NA"))Then
If Not String.IsNullOrEmpty(r("Date").ToString) And Not String.IsNullOrEmpty(r("Acknowledgement").ToString) Then
DateModify=System.Text.RegularExpressions.Regex.Match(r("Date").ToString,"[0-9\\\/\-]+").Value.Trim
AcknowledgmentModify=System.Text.RegularExpressions.Regex.Match(r("Acknowledgement").ToString,"[0-9\\\/\-]+").Value.Trim
Try
If Convert.ToDateTime(DateModify).ToString("yyyy/MM/dd") >= convert.ToDateTime(startDate).ToString("yyyy/MM/dd") AndAlso Convert.ToDateTime(DateModify).ToString("yyyy/MM/dd") <= convert.ToDateTime(endDate).ToString("yyyy/MM/dd") And Convert.ToDateTime(AcknowledgmentModify).ToString("yyyy/MM/dd") >= convert.ToDateTime(startDate).ToString("yyyy/MM/dd") AndAlso Convert.ToDateTime(AcknowledgmentModify).ToString("yyyy/MM/dd") <= convert.ToDateTime(endDate).ToString("yyyy/MM/dd") Then
r("c3")="date and acknowledgment is winthin month"
Else
r("c3") = "Not date and acknowledgment is winthin month"
End If
Catch ex As SystemException
If DateTime.ParseExact(DateModify.ToString, "d/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy/MM/dd") >= convert.ToDateTime(startDate).ToString("yyyy/MM/dd") andalso DateTime.ParseExact(DateModify.ToString, "d/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy/MM/dd") <= convert.ToDateTime(endDate).ToString("yyyy/MM/dd") And DateTime.ParseExact(AcknowledgmentModify.ToString, "d/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy/MM/dd") >= convert.ToDateTime(startDate).ToString("yyyy/MM/dd") andalso DateTime.ParseExact(AcknowledgmentModify.ToString, "d/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy/MM/dd") <= convert.ToDateTime(endDate).ToString("yyyy/MM/dd") Then
r("c3")="date and acknowledgment is winthin month"
Else
r("c3") = "Not date and acknowledgment is winthin month"
End If
End Try
Else
r("c3") = "Date or Acknowledgement is blank"
End If
Else
r("c3") = "Data is missing"
End If
Else
r("c3") = "False"
End If
Next
output :
can we specify this month without mentioning the month
I need to change the data as if 1-02-2023 then it should change as january 2023
in the column there are so much rows but it should pick only date and change that as mmm-yyyy format
you can try this way
DateTime.ParseExact("01-02-2023", "M-dd-yyyy", CultureInfo.InvariantCulture).ToString("MMMM yyyy")
output :-
there are other values also in the column but it should capture only date
Book1.xlsx (1.4 MB)
this is the data
you can try this in assign activity
dt = dt.AsEnumerable().Where(Function(row) DateTime.TryParseExact(row("Date").ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, Nothing)andalso DateTime.TryParseExact(row("Acknowledgement").ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, Nothing)).CopyToDataTable()
Note : Mention your Column Names
its taking more time
its taking more time to execute
You need to enable Macro Settings in Excel
Open Excel Click on Options->Trust Center->TrustCenter Settings->Macro Settings->Enable below options
i have did this.I have enabled the check box
iam getting this error
Click on Debug and show the error message