Alteryx Designer Desktop Discussions

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

Teradata Current_Date Query Error

BetoZM
7 - Meteor

Hello everyone!

I'm pretty new here using Connect In-DB so I can get all the data I need from a Teradata Server, using ODBC Teradata Drive.

 

I'm trying the simplest thing that is "SELECT CURRENT_DATE" in the SQL Query Builder, but I always get an error: Error: Connect In-DB (1): Error SQL Prepare: [Teradata] [ODBC Teradata Driver] [Teradata Database] (-3707) Syntax error, expected something like a name or a Unicode delimited identifier or an 'UDFCALLNAME' keyword or '(' between the 'FROM' keyword and ';'.

 

I've tried even "GETDATE ()", searching an answer from this forum, but I still l can't get a simple date.

 

I'm trying to get this simple thing to start automate inside SQL queries, like:

If it is Month 01 and Day less than 21 then bring everything that is called "B01"
If it is Month 01 and Day greater than 22 but smaller than 30 then bring everything that is called "B02"

 

It is a quick example which, of course, have another level of complexity inside it's own code.

 

Again, pretty new using Connect In-DB, so any help would greatly be appreciated!

3 REPLIES 3
Armon24
Alteryx
Alteryx

Copy the query into Notepad++. Remove all line breaks and extra spaces from the query and make sure there is a space after the words Select, From, Where, Case, When, Then, Else, Like, And, End, As, etc. Then paste the SQL query in the SQL Editor tab.

BetoZM
7 - Meteor

I still get that error, I've tried to restart Alteryx, clear the cache from the clipboard and try again.

 

BetoZM_0-1672786974221.png

 

Armon24
Alteryx
Alteryx

@BetoZM 

You need to specify what table you are grabbing data from. Here is an example below where I have a from statement pulling data from table Audit.

 

Armon24_0-1672945659279.png

 

 

You could also try using the visual query builder to build out this SQL code.

Labels