Aaron
|
| Posted: 10/17/2002, 11:14 AM |
|
Does CCS allow IF...THEN in datasource SQL statement?
I just want to check to make sure it's a syntax problem of code problem I am running into.
Thanks!
|
|
|
 |
Andrew B
|
| Posted: 10/17/2002, 5:03 PM |
|
If your provider allows it then CCS allows it. If not, then you will get an error when ccs attempts to run the code against the database.
If you are using SQL server : look into 'CASE'. General syntax is
select
field1
, (CASE <db_field>
WHEN <value> THEN <return>
WHEN <value2> THEN <return2>
ELSE <returnElse>
END
) as [FieldAlias]
If you are dealing with nulls in sql server you have to do it a bit differently. You leave <db_field> blank and do the actual comparison in the WHEN clause, so instead of just [value] you would have [db_field]=<value>
Look into specifics for your platform, or post here adn I will try to help
|
|
|
 |
|