We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Stored Procedures

rmishra
5 - Atom

I have a stored procedure which needs to take the current year as input how do i achieve this?

 

I tried the following it works in SQL but it gives me an error in Alteryx

 

declare @dateToday int;
set @dateToday= Year(getDate())

exec source.procedure
@Year = @dateToday

2 REPLIES 2
geraldo
13 - Pulsar

Hi

One suggestion is to use the dynamic imput tool. Make date change

 


create procedure new_proc ( @from_date smalldatetime )
as

SELECT * FROM TBL_SQLSERVER_EMITIDOS where cptdat = @from_date

 

Dynamic input configuration:

 

clipboard_image_0.png

 

clipboard_image_1.png

 

 

clipboard_image_2.png

 

clipboard_image_4.png

 

make sure you can

 

[]

 

 

 

 

 

 

DavidThorpe
Alteryx Alumni (Retired)

Hi @rmishra 

 

The following awesome FAQ by @DiganP will walk you through how to achieve this:

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Stored-Procedures-FAQ/ta-p/376886

 

Thanks 

Labels
Top Solution Authors