• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1455
  • Last Modified:

SQL Case Statement against a Visual Foxpro Database using VB.6

I wish to execute an SQL case statement against a Foxpro Database using VB6.0,  using Visual Foxpro ODBC Driver

I use the following SQL command against  a sybase DB an it works perfectly.
SELECT  P_CRITICAL , (CASE WHEN P_CRITICAL = 'Quality' Then '+'  Else  '-'  END) as P_CRITICAL FROM Sybase

How do I execute an SQL Case statement against a Foxpro Database.

I can use the select * from Foxprodatabase successfully, it's the Case statement (or something that would achieve the same results) is what I'm hoping for.  I don't know what version of Foxpro the databses are.  

Thanks in advance
Sean

0
SAJC
Asked:
SAJC
  • 3
  • 2
1 Solution
 
SAJCAuthor Commented:
Hi Leonstryker

thanks for that info I placed it into my SQL and I got [Microsoft][ODBC Visual Foxpro Driver]command contains unrecognised phrase/keyword.  

SELECT EC_ECMPNO, DO Case CASE EC_ECMPNO = 'C-0050','TEST' ENDCASE from ECMP

Could you help me get the syntax correct as I've never accessed a Foxpro Database before and from what I read the SQL
is different than e.g. Access, sybase, Iseries.

Thanks
Sean
0
 
leonstrykerCommented:
I am not that familiar with FOXPRO syntax as well.  You may want to post this question in the FOXPRO TA, or place a link post there.
0
 
SAJCAuthor Commented:
thanks Leonstryker

I got the problem solved in the Foxpro Forum.

Sean
0
 
leonstrykerCommented:
Like I said for FOXPRO syntax that is the place to go.  Now please close the question (and the one in the VB area as well)

Leon
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now