PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 23 → [WD 21]SQL Query
[WD 21]SQL Query
Débuté par Ericus, 13 juil. 2018 14:12 - 1 réponse
Posté le 13 juillet 2018 - 14:12
Good day

How can you use a parameter inside a query in a CASE statement.

I.e. I want to pass a parameters {Period} = 2 as a field in the query and then se that in a case i.e. CASE WHEN Period = 1 then blah blah else blah blah END

So my query reads:

SELECT xyz, 1 as Period, CASE WHEN Period = 1 etc. etc. from tablename

Thanks in advance



Ericus Steyn
Posté le 13 juillet 2018 - 19:38
Maybe to try with
sSQL is string = "SELECT xyz, 1 as Period, CASE WHEN Period = %1 etc. etc. from tablename"

StringBuild(sSQL,1)