SQL Editor Like criteria
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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%'
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
All the best,
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Used your solution got the error as - "Expected Something between teh 'AND' keyword and the 'Select' Keyword
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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%')
![](/skins/images/72080B1993C0EC7A53569ADF25905C2F/responsive_peak/images/icon_anonymous_message.png)