# CSV Date Filter Issue

**URL:** <https://forum.uipath.com/t/csv-date-filter-issue/18897>\
**Category:** Help\
**Tags:** studio, excel, system, activities\
**Created:** [January 7, 2018, 12:45am UTC](https://forum.uipath.com/t/csv-date-filter-issue/18897 "2018-01-07T00:45:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShubhankarJogalekar](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@ShubhankarJogalekar](https://forum.uipath.com/u/ShubhankarJogalekar)\
**Post date:** [January 7, 2018, 12:45am UTC](https://forum.uipath.com/t/csv-date-filter-issue/18897/1 "2018-01-07T00:45:00Z")

</div>

Hi,

I’m trying to filter the CSV data after a particular date. But filter is returning wrong number of records.  
CSV file is received through an e-mail. PFA code file.

Steps I’m following are

1. Read CSV into data table

2. Apply filter on data table. (Date \>= 2nd Nov 2017)  
dt.Select(“Date\>='”+Convert.ToDateTime(“02/11/2017”).ToShortDateString()+" “+Convert.ToDateTime(“02/11/2017”).ToShortTimeString+”'")

3. Store the filtered data in another excel.

Date format is dd/MM/yyyy

[CSV Filter.zip](https://global.discourse-cdn.com/uipath/original/2X/7/70bc2cb8605cc978fcbb0953681fd5fa9523ac10.zip) (3.4 KB)

Can anyone help?  
Thanks

---

<div class="post-metadata">

**Author:** ![Susana](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/susana/32/611_2.png) [@Susana](https://forum.uipath.com/u/Susana)\
**Post date:** [January 7, 2018, 12:45pm UTC](https://forum.uipath.com/t/csv-date-filter-issue/18897/2 "2018-01-07T12:45:30Z")

</div>

Hello @ShubhankarJogalekar,

Try to define your CurrentCulture and then use **dtInputData.AsEnumerable().Where(Function(row) Convert.ToDateTime(row(“Joining\_Date”).ToString) \>= Convert.ToDateTime(“02/11/2017 00:00”)).ToArray()**

[Main\_option1.xaml](https://global.discourse-cdn.com/uipath/original/2X/f/f18e9f9ce534b7033393a24212c207004dc6397a.xaml) (17.9 KB)

Or you can try directly

**dtInputData.AsEnumerable().Where(Function(row) Date.ParseExact(row(“Joining\_Date”).ToString,“dd/MM/yyyy HH:mm”,System.Globalization.CultureInfo.InvariantCulture) \>= Date.ParseExact(“02/11/2017 00:00”,“dd/MM/yyyy HH:mm”,System.Globalization.CultureInfo.InvariantCulture)).ToArray()**

[Main\_option2.xaml](https://global.discourse-cdn.com/uipath/original/2X/9/92dfa6fdd0aa8f6829c7790a87bc480dd26398df.xaml) (16.4 KB)

> [@Get a date in formart "dd/mm/yyyy"](https://forum.uipath.com/t/get-a-date-in-formart-dd-mm-yyyy/2440):
>
> How can I get a specific date format? In my case dd/mm/yyyy" I know that I could convet.toshortdatestring but I need that my variable will be a date not a string

Regards,  
Susana

---

<div class="post-metadata">

**Author:** ![ShubhankarJogalekar](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@ShubhankarJogalekar](https://forum.uipath.com/u/ShubhankarJogalekar)\
**Post date:** [January 8, 2018, 1:19am UTC](https://forum.uipath.com/t/csv-date-filter-issue/18897/3 "2018-01-08T01:19:44Z")

</div>

Hi @Susana

Thanks for the solution. It worked perfectly.

🙂

---

<div class="post-metadata">

**Author:** ![karthik\_bethi](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@karthik\_bethi](https://forum.uipath.com/u/karthik_bethi)\
**Post date:** [May 15, 2018, 5:00pm UTC](https://forum.uipath.com/t/csv-date-filter-issue/18897/4 "2018-05-15T17:00:51Z")

</div>

hi,

Please check the tutorial,

[![](https://global.discourse-cdn.com/uipath/original/4X/4/c/7/4c73a5cb329a7d36a0e9f3393cc1049018fa2794.jpeg "Read csv and write to excel uipath tutorial for beginners") ](https://www.youtube.com/watch?v=JDVk70-zf7o)

Thanks,  
Karthik

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [October 29, 2018, 9:20am UTC](https://forum.uipath.com/t/csv-date-filter-issue/18897/5 "2018-10-29T09:20:00Z")

</div>

Closed on October 29, 2018, 9:20am UTC


