Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Using criteria to filter OleDB data source

AmyM1
5 - Atom

I'm trying to import a selection of data from a data source. I want to select the entries with the most recent date but I don't know what to put in the criteria to filter just the most recent date. 

AmyM1_0-1596722186973.png

 

6 REPLIES 6
kumaranvr1984
8 - Asteroid

HI Amy,

 

You can write sql code in sql editor to get the latest date entries.

 

 

AmyM1
5 - Atom

Thanks, where do I find out how to do that?

kumaranvr1984
8 - Asteroid

Hi Amy,

 

You can find it in the last tab of the table query. 

 

kumaranvr1984_0-1596725482917.png

 

Are you trying to connect a table from SQL server or what is the source DB?

 

kumaranvr1984
8 - Asteroid

Hi Amy,

 

Sql Query like below in sql editor

 

select master.dbo.Emp_subdetails.Empid,
master.dbo.Emp_subdetails.DOB
from master.dbo.Emp_subdetails
where master.dbo.Emp_subdetails.DOB = (select distinct max(DOB)from master.dbo.Emp_subdetails)

 

or try give date condition in criteria  filed on Visual query builder tab like below

Note: you have to give this criteria for specific field not for all fields.

 

Here it is DOB

 

= (select distinct max(DOB)from master.dbo.Emp_subdetails)

 

Hope this helps.

AmyM1
5 - Atom

That's really helpful, thankyou!

kumaranvr1984
8 - Asteroid

Hi Amy,

 

If this resolves your issue please mark this as solved.

 

Thanks

Labels