Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Keith Patterson
  Where is Keith Patterson?
 Roanoke
 Virginia - United States
 Keith Patterson
 Tags
Subject: RE: Query question
Thread ID: 228555 Message ID: 228572 # Views: 1 # Ratings: 2
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Wednesday, May 20, 2009 12:10:37 AM         
   


> I am running this query
>
> select p_reason from hrpersnl where p_reason = 'PRN'
>
> and it is returning rows where p_reason = 'PRN', but it is also returning rows where p_reason = 'PRN2PT' and rows where p_reason = 'PRN2FT'.
>
> This is a FoxPro table (ABRA) and I'm not terribly familiar with Foxpro syntax, but I've not seen anything act like this before.
>
> Any ideas why I'm experiencing these strange query results?
>
> Thanx,
>
> Keith


... WHERE p_reason LIKE 'PRN' 
Totally Standard SQL, exact match, optimizable. 
If you want 'begins with':
... WHERE p_reason LIKE 'PRN%' 
If you want 'contains': 
... WHERE p_reason LIKE '%PRN%' 

As Foxpro is case-sensative, you'd perhaps prefer:
.. WHERE UPPER(p_reason) LIKE 'PRN'


-Anders

ENTIRE THREAD

Query question Posted by Keith Patterson @ 5/19/2009 9:33:41 PM
RE: Query question Posted by Borislav Borissov @ 5/19/2009 9:41:49 PM
RE: Query question Posted by gerrit broekhuis @ 5/19/2009 9:44:27 PM
RE: Query question Posted by Borislav Borissov @ 5/19/2009 9:54:37 PM
RE: Query question Posted by Stefan Wuebbe @ 5/19/2009 10:06:03 PM
RE: Query question Posted by Andy Kramek @ 5/19/2009 10:51:10 PM
RE: Query question Posted by Keith Patterson @ 5/21/2009 6:45:01 PM
RE: Query question Posted by Anders Altberg @ 5/20/2009 12:10:37 AM