Alteryx Designer Desktop Discussions

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

Date Filter In DB

ryanwahl
5 - Atom

Hello.

 

I am working within Alteryx Designer on a workflow that is connected to my organization's SQL Server. One of my In-DB connections is a large database with item transaction history that goes back several years. I really just want to focus on a few types of transactions that have occurred in the last 24 months. Although I am easily able to filter while in DB for the types of transactions and other attributes I want to focus on, there is still a lot of transaction history withing the DB, going back, that I would like to filter out.

 

Unfortunately, the transaction date field is a V_WString and the Filter In-DB function cannot recognize the function that I would otherwise enter as: [DateTime_Out] >= DateTimeAdd(DateTimeToday(),-24,"months")

 

If I try to perform this filter after I "Data Stream" out my data, it adds more processing time to my workflow with the amount of data from the DB connection. Obviously, If I can figure out a way to parse the string data for the transaction "date" field into date format and filter to the last 24 months, while in DB this step would run more efficiently. Is there a reliable way to parse a V_WString into a date field so that I can filter out transaction dates older than the last 24 months?

 

Thank you.

1 REPLY 1
Qiu
20 - Arcturus
20 - Arcturus

@ryanwahl 

This is not really Alterxy related, hehe.

I am not SQL expert, but maybe below can help you.

https://www.sqlshack.com/sql-server-functions-for-converting-string-to-date/#:~:text=In%20SQL%20Serv....

Labels