Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql Statement
Message
From
20/03/2000 14:28:26
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00347998
Message ID:
00348025
Views:
35
Your correct Philip. If your performing the SQL statement in Foxpro then the CASE statement will not work. Thanks for catching my assumption.

Just goes to show you how "one-tracked" someone can be.<grin>

>Jeffrey,
>
>If you are using SQL Server, then Stephen's solution will work. But, I don't believe that the Fox driver supports CASE in SQL statements. You can use a union, but remember that fields must be the same size, thus add SPACE(33) to the first errmsg so that it will be the same size as the second. There can only be one order by clause, and it must numerically refer to a column.
>
>
>SELECT TEMPALIAS.*,
> MF_158.DATE_IN AS IMPORTED,
> 'Record already imported.'+SPACE(33) AS Errmsg
> FROM TEMPALIAS, MF_158
> WHERE ALLT(TEMPALIAS.UNIQKEYSAS) = ALLT(MF_158.UNIQKEYSAS)
> UNION
>SELECT TEMPALIAS.*,
> MF_158.DATE_IN AS IMPORTED,
> 'Records previously found as errors but have passed since.' AS Errmsg
> FROM TEMPALIAS, PROB_158, MF_158
> WHERE ALLT(TEMPALIAS.UNIQKEYSAS) = ALLT(PROB_158.UNIQKEYSAS)
>INTO CURSOR INPR158
> ORDER BY 1 ???
>
>
>..., or something like that.
>
>Hope this helps,
>
>Phil
Stephen Rushton Jr.
Stephen.T.Rushton@lmco.com
Previous
Reply
Map
View

Click here to load this message in the networking platform