Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

SQL Editor Like criteria

In SQL Editor, trying to put an like criteria for employee name after the date filter, but not working , 

WHERE (dates) between '2023-01-01' AND '2023-12-31'
AND [Name], 'Mark%'

4 REPLIES 4
BS_THE_ANALYST
14 - Magnetar

Hi @balajivenkateshan

Two things, you have a random comma between [Name] and 'Mark%' which is not okay.

 

Since you're using wildcards in SQL, isn't it common to use the LIKE operator here? I guess it depends on your flavour of SQL but it's what I've been exposed to before:

Screenshot 2024-03-11 103704.png

 

All the best,

Ben

Used your solution got the error as - "Expected Something between teh 'AND' keyword and the 'Select' Keyword

BS_THE_ANALYST
14 - Magnetar

@balajivenkateshan what formula did you use in the SQL editor this time round? What RDMS are you connecting to i.e. Oracle/SQL/SQLlite/Postgres

 

All the best,

BS

BS_THE_ANALYST
14 - Magnetar

@balajivenkateshan I hope you're using brackets here as well as you're chaining multiple ANDS together i.e:

WHERE (dates) between '2023-01-01' AND '2023-12-31'
AND [Name], 'Mark%'

 

should be:

 

WHERE ((dates) between '2023-01-01' AND '2023-12-31')
AND ([Name], 'Mark%')

Labels