hi Team,
i m Having set of birthdays i need to get all the row for today with out consider the year
like above is Their any way to get this Results
Thank you
Tharusha
hi Team,
i m Having set of birthdays i need to get all the row for today with out consider the year
like above is Their any way to get this Results
Thank you
Tharusha
Please check this article
Could you please share sample sheet(After masking/removing sensitive info)?
@Tharusha_Fernando
may we ask you to run following in immediat box and share the result with us:
YourDataTableVar.Rows(5).ItemArray
In general we can try with following logic:
CDate(“05-06-2017”).toString(“ddMM”).Equals(now.toString(“ddMM”))
Just need to adopt the Date Conversion based on the screenshot from immediate Box run
As we can expect that no rows will be found, we will handle result defensive:
Assign:
LeftSide: Result | DataType: List(Of DataRow)
Right side:
(From d In YourDataTableVar.AsEnumerable
Where Not (isNothing(d("regDate" )) OrElse String.IsNullOrEmpty(d("regDate").toString))
Where CDate(d("regDate").toString.Trim).toString("ddMM").Equals(Now.ToString("ddMM"))
Select r = d).toList
Based on Result.Count > 0
then: dtFiltered = Result.CopyToDataTAble
else: dtFiltered = YourDataTableVar.Clone
@Tharusha_Fernando - Since you have 1000+ rows in the excel , I am providing the LINQ solution…
Read Range your sheet and call the output as dt
Assign
(From r In dt.AsEnumerable
Where DateTime.parse(r("regDate").tostring).Month = Now.Month And
DateTime.parse(r("regDate").tostring).day = now.Day
Select r).CopyToDataTable
Note: My date is 8/31 today so it is listed 8/31 bdays if your country date is 9/1 already it will show the 9/1 birthdays…
Hope this helps…
It woks @prasath17 Thank you Guys
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.