need some SQL help

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

can some look at this select statement and tell me whats wrong with it/
I keep getting an error on the SELECT.

dbCommand = New SqlDataAdapter("select EffectiveDate,RD as type" & _
"SELECT Case type WHEN
type='Yes' THEN type='Regional Developer' End as type" & _
"PointsDistributed from Points",
dbConnection)


what i need to to is if type=yes then type=regional developer and if type=no
then type=national developer

thanks
 
try this:

dbCommand = New SqlDataAdapter("select EffectiveDate, " & _
" Case WHEN RD='Yes' THEN
'Regional Developer' ELSE "'National Developer' End as type " & _
"PointsDistributed from Points",

Regards
Martin
 
Back
Top