Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT Statement
Message
From
04/11/2008 16:05:14
 
 
To
04/11/2008 15:58:25
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01359628
Message ID:
01359637
Views:
31
>>>>The following SPT string was suggested a while back and has worked fine until today. Today it hit a part number taht was inspected twice on the same day in which one record shows rejected the other accepted. In this case I only need the accepted returned. What do I need to do to make this happen?
>>>>
>>>>testString = "Select recseq, CASE WHEN faistatus = 1" +;
>>>>" THEN 'Accepted' WHEN faistatus = 2 THEN 'Rejected' ELSE 'SEE ORIGINAL FAI' END" +;
>>>>" As fais, inspectord, dwgrev From webprddt6.drawmfai mt1" +;
>>>>" JOIN ( SELECT webprddt6.drawmfai.partno, MAX(webprddt6.drawmfai.inspectord) AS MaxDate FROM webprddt6.drawmfai GROUP BY webprddt6.drawmfai.partno, webprddt6.drawmfai.vendorcode ) mt3" +;
>>>>" ON mt3.partno = mt1.partno AND mt3.MaxDate = mt1.inspectord" +;
>>>>" Where (mt1.partno = '116405-015' Or mt1.partno = '116405-015') And Left(mt1.vendorcode,5) = 'G7135'"
>>>
>>>
>>>
>>>and whatever = 'Accepted'
>>
>>Nope,
>>That will filter ALL records and you get only Accepted records as a result.
>
>okay then.. and whatever != 'rejected'

:-)
If I understood Steven correctly he wants ALL records no matter if they are rejected or accepted or whatever they are, just when he have double records for one day one accepted and one rejected he wants only accepted one.
But maybe I'm wrong and you are right.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform