Sorry Tommy, but I will deliver another piece of code, because:
SELECT icase(intSaletype = 1, 'Sale', intSaletype = 2, 'Return', 'Something else') as SaleType from table
has a sideeffect: if the first record in the result table contains 'Sale' the width of the column will be C(4). If the first record contains 'Return' it will be C(6).
So if N is the desired width of the column:
SELECT PADR(icase(intSaletype = 1, 'Sale', intSaletype = 2, 'Return', 'Something else'),N) as SaleType from table
Hth
>Hey Guys.....
>
>From my boss....
>
>
>"Can either of you tell me what the syntax is to do a CASE statement in a db lookup, for a fox pro db.
>
>This is what it would look like for sql server:
>
>SELECT ‘Sale Type’ = CASE intSaletype WHEN 1 THEN ‘Sale’ WHEN 2 THEN ‘Return’ ELSE ‘Something else’ END
>FROM <table>
>"
>
>Any idea? I am not skilled mssql, so that's why I'm asking you gurus....