Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 '<=' operator with Varchar in T-SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-02 : 10:06:10
Jibble writes "Using the '<=' operator with SQL strings. Here's the gist of my dilemma:

The problem I'm running into is SQL ignores the '=' in the '>=/<=' operators when comparing strings. If I run a query such as:

SELECT authors FROM psmd_prod.dbo.document_list WHERE authors >= 'A%' AND authors <= 'F%' ORDERBY authors

I get a listing of doc records for 'A - E'. I should get a listing of doc records for 'A - F'. I 've played with case, added '%' and tried numerous other tweeks but still cannot get SQL to recognize the '=' in the operator. why does SQL balk at this when using this operator with character strings. According to the SQL documentation, it should work."
   

- Advertisement -