Free Trial

Alteryx Designer Desktop Ideas

Share your Designer Desktop product ideas - we're listening!
Submitting an Idea?

Be sure to review our Idea Submission Guidelines for more information!

Submission Guidelines

Invalid SELECT statement - Unexpected token "CURRENT_DATE"

I use custom SQL statements in many of my input tools.  I also use the global system variable CURRENT_DATE to dynamically get a date range in my queries.  Alteryx is trying to parse and understand the query, but it fails to understand CURRENT_DATE.  Each time the time I selected to view the SQL in the input tool, a parsing error is generated,  "Invalid SELECT statement. Unexpected token "CURRENT_DATE" at line xx, pos xx".  Dismissing this error by clicking OK is all that is needed to workaround, but this is still less than ideal.

 

Please correct this so CURRENT_DATE will be an "expected token".

6 Comments
Inactive User
Not applicable

I am having the same problem.  Not being very SQL savvy, I'm trying to take a provided script and edit it as needed using the visual tables.  

 

My error is slightly different, but it has the same root:

 

Invalid SELECT statement. 

Unexpected token "Connect" at line 43, pos 18

 

The SQL works and pulls data, but it won't allow me to edit using the visual tables.

 

Did you find a solution?   Thanks.

wmsiegfried
5 - Atom

I'm getting this same message: Invalid SELECT statement. Unexpected token at "at" line 2 pos 55.

 

The SQL [Test Query] runs fine. However, the message still pops up when I go into the SQL Editor.

 

Has there ever been a solution to this issue? Appreciate any reply.

SeanAdams
17 - Castor
17 - Castor

If I'm not mistaken, the ANSI compliant syntax for this is 

 

Select CURRENT_TIMESTAMP, field 2

from Tablename

 

CURRENT_TIMESTAMP is the ANSI compliant version of all the proprietary versions of this on different database engines (like MS SQL Server uses getdate() but can also use the ANSI compliant version).

 

I've tested this using Alteryx onto SQL server 2016, with no error and good resultset.

wmsiegfried
5 - Atom
Thanks for your reply to my issue. I should have sent the SQL I used to make my situation a little clearer. I do not have current_date in my SQL statement.

Here is my error message and the SELECT statement I'm using:

[cid:image001.png@01D356E1.76A21380]

select rolb_adm.user_attribute.value_string as Interpose_ID,
rolb_adm.d3_user.HOST_ID as SSO_GUID,
max(from_tz(rolb_adm.d3_user.last_login_ts, 'UTC') at time zone 'US/Central') as LAST_OLB_LOGIN,
max(from_tz(rolb_adm.mdm_user_device.last_login_ts, 'UTC') at time zone 'US/Central') as last_mobile_login

Thanks,

wmsiegfried

FIRST TENNESSEE

Confidentiality notice:
This e-mail message, including any attachments, may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for delivery of this message to the intended recipient(s), you are hereby notified that any dissemination, distribution, or copying of this e-mail message is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete this e-mail message from your computer.
wmsiegfried
5 - Atom

I see that others have had this same issue. However, I see no solution.

 

When I try to edit my query I get the following error:

 

Invalid SELECT statement,

Unexpected token "a" at line 2, pos 52

 

My job runs fine, but the "Parsing error" shown above limits me in editing my "Visual Query Builder to add selects to my workflow.

 

Select rolb_adm.user_attribute.VALUE_STRING As Interpose_ID, rolb_adm.d3_user.HOST_ID As SSO_GUID,
max(from_tz(rolb_adm.d3_user.last_login_ts, 'UTC') at time zone 'US/Central') as LAST_OLB_LOGIN,
max(from_tz(rolb_adm.mdm_user_device.last_login_ts, 'UTC') at time zone 'US/Central') as last_mobile_login
From rolb_adm.d3_user, rolb_adm.user_attribute, rolb_adm.mdm_user_device
Where rolb_adm.d3_user.ID = rolb_adm.user_attribute.USER_ID And rolb_adm.d3_user.ID = rolb_adm.mdm_user_device.USER_ID And rolb_adm.user_attribute.NAME = 'd3HostIdEventing' Group By rolb_adm.user_attribute.VALUE_STRING, rolb_adm.d3_user.HOST_ID

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Status changed to: Accepting Votes