Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

Check for varchar does not contains character

Hi,

I'd like a query to select rows where a field, called [Value] where it does not contain character "."

For example the table is called "tblMyTable"

Thanks in advance
0
rwallacej
Asked:
rwallacej
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
Try:

SELECT [ColumnList] FROM [tblMyTable] WHERE CHARINDEX('.',[Value]) = 0
0
 
tigin44Commented:
try this
SELECT *
FROM tblMyTable
WHERE CHARINDEX('.' ,  [Value]) > 0

Open in new window

0
 
tigin44Commented:
does not contain... so this will be true...
SELECT *
FROM tblMyTable
WHERE CHARINDEX('.' ,  [Value]) = 0

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
QlemoC++ DeveloperCommented:
select * from tblMyTable where [Value] not like '%.%';
0
 
rwallacejAuthor Commented:
excellent, thank-you
0
 
rwallacejAuthor Commented:
Qlemo - thank-you for help

tigin44 - thank-you but I got an error with the code, I have used Qlemo's instead
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now