SunnyJha
(Sunny Jha)
June 11, 2024, 9:50am
1
I have a datatable dt in which I have a column called Start Date along with other columns. Now the date format is “M/d/yyyy” in this start date column. I want to remove all those rows which are not of current year.
So if this year is 2024 then remove all other rows whose start date is anything else.
i/p dt:
o/p dt:
ppr
(Peter Preuss)
June 11, 2024, 9:58am
2
dtFiltered =
(From d in dtData.asEnumerable()
Let dps = d("Start Date").toString.Trim
Let dp = CDate(dp)
Where dp.Year = 2024
Select r =d).CopytoDataTable
Also have a look here:
This FirstAid Tutorial will describe how DateTime parsing issues can be analyzed and handled.
Click spoiler text when in a hurry:
Example
Assignment
Following Excel data will be processed and the corresponding Quarter is to calculate for the particular task date
Input data:
[input_raw]
Quarter Calculation
Quarter = CInt(Math.Ceiling(YourDateTimeVar.Month / 3 ))
Initial Implementation
[initial_flow_raw]
tmpTaskDate = DateTime.ParseExact(row("Date").toString.Trim, "dd.MM.yyyy", CultureInf…
This FirstAid Tutorial will describe how a the source contains no DataRows EXCEPTION can be handled.
Introduction
Let’s have a look at the following filter data table scenario:
Name
CCode
Tom
US
Charlotte
FR
Seema
IN
Jean
FR
Assignment:
Filter all rows on a particular Country Code like FR, UK, ES, UK…
Ensure that all CCode data column values are trimmed
Ensure that the Filter check is case insensitive
we can implement it e.g. with the help of a LINQ statement:
dtData.AsE…
1 Like
system
(system)
Closed
June 14, 2024, 9:58am
3
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.