Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query gives wrong results
Message
From
31/07/2001 13:20:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Query gives wrong results
Miscellaneous
Thread ID:
00537861
Message ID:
00537861
Views:
28
Hi All,

I have a very simple query that is giving bad results. The data that appears in some of the fields in not the same as the data that is in the actual tables.

SELECT PROJ.user_proj_no, ;
PROJ.sold_by, ;
PROJ_SEG.select, ;
SEGMENT.employeur, ;
PROJ_SEG.proj_mgr_no, ;
PROJ.PROJ_NO ;
FROM main_one!PROJ LEFT OUTER JOIN main_one!PROJ_SEG ;
ON PROJ.proj_no = PROJ_SEG.proj_no ;
LEFT OUTER JOIN main_one!SEGMENT ;
ON PROJ.sold_by = SEGMENT.seg_no ;
WHERE PROJ_SEG.select = 1 ;
AND PROJ_SEG.proj_mgr_no = 0 ;
AND PROJ.sold_by > 0 ;
AND !ISNULL(PROJ.po_dt) ;
AND SEGMENT.employeur = 1 ;
GROUP BY PROJ.user_proj_no, SEGMENT.employeur ;
ORDER BY SEGMENT.employeur, PROJ.user_proj_no

the result gives:
01081, 14, 1, 1, 0, 5356
01247, 12, 1, 1, 0, 5585

The tables show:
01081, 14, 0, 1, 0, 5356 <- field 'select' shows 0
01247, 12, 1, 1, 435, 5585 <- field proj_mgr_no shows 435

Which means that I should not get any records.
Any body have an idea? Is the table header corrupt?

TIA
Mike
Next
Reply
Map
View

Click here to load this message in the networking platform