Filter Date in Date Table?


#1

I have Data table name resultDt The datas are shown below

My requirement is to get the last 3 months count of the name.

For example NewDate = today.Addmonths(-3) it will give 03-04-17.Now the NewDate is Compare to DataTable resultDt.After the NewDate I have 3 records So it Should return Count of Rows as “3”.

Can some one help me to achieve this.

Thanks in advance
(Jothyprasanth M)


#2

How about resultDt.Select("Date >today.Addmonths(-3)") ?


#3

NewDate=DateTime.Today.AddMonths(-3)

resultDt.Select("Date =’ “+NewDate+” ’ " )

i tried this way but i shows Error like

“Implicit Conversion from ‘Date’ to ‘String’”


#4

Try

string NewDate=DateTime.Today.AddMonths(-3).ToString(“MM-dd-yy”)

resultDt.Select("Date >=’ “+NewDate+” ’ " )


#5

It gives error like this
Assign : Syntax error: Missing operand after ‘Date’ operator

Date is a DateTable Column

The resultDt DataTable values are extracted from Extract Structured Data Activity


#6

I would try few things

Keep date in Brackets [Date] — Incase of space in Column name

Try # instead of single quotes (“Date = #”+NewDate+"#" )


#7

We should assign this as DataRow Right?


#8

DateRow Array --> Select Array and Datarow as Type


#9

Oops …

Error : Cannot Find the Column [Date]