Simple statment with where clause returns no results

DJ P
DJ P used Ask the Experts™
on
Ok don't know what I am missing here. I have a table (MasterDataFiles) in a sql database that has three fields. GroupName, MemberSamAccountName, and GroupDescription.

As a Test I imported two records from a flat file. I receive no errors on the import. Now here is my strange issue. In the server management studio if I run a simple select statement such as Select * from MasterDataFiles it returns both records. However if I use a where clause such as select * from MasterDataFiles where GroupName = 'ShareKnowledge' it returns no records.

I cannot figure out why. I have no type o's of any kind. Just for an additional test I tried the where clause on the remaining fields and got the same result. I don't know sql that well but I have never seen this before when working with one table for such a simple statement. What might I be missing?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
By "sql database" do you mean SQL Server?

Maybe leading or trailing whitespace?

Try:
select * from MasterDataFiles where GroupName like '%ShareKnowledge%'

Author

Commented:
Sorry, Yes, SQL server. And you nailed it. It turns out there were whitespaces after.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial