This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
DateTimeAdd(DateTimeNow(),-4,"years") will give you 4 years prior to today's date. If you have your query in a macro, you could use the interface tools to pass this value dynamically into your SQL query
My thought was more about using a placeholder value in your query that is dynamically replaced in an Alteryx workflow using a value calculated from a formula. After creating the desired date in the proper format in Alteryx, you could pass that through to your query using a dynamic input tool that replaces the placeholder text in the where clause of your statement.