Crystal Report

ZhumaG
ZhumaG used Ask the Experts™
on
Good day,
Please help.
I need to change (if {?Language} = "ENG" then {VERSIONS.VERSION} = 2 else if {?Language} = "RUS" then {VERSIONS.VERSION} = 1) statment to VERSIONS.VERSION IN (COALESCE((SELECT VERSIONS.VERSION FROM VERSIONS WHERE VERSIONS.DOCNUMBER=Profile.DOCNUMBER AND VERSIONS.VERSION=2), 1)) in Crystal reports.
It means the report must show version =2 if exist and if not - version = 1.
Thanks in advance,
Gulshat
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
Commented:
Create a SQL expression:
(COALESCE((SELECT VERSIONS.VERSION FROM VERSIONS WHERE VERSIONS.DOCNUMBER=Profile.DOCNUMBER AND VERSIONS.VERSION=2), 1))

Author

Commented:
Thanks a lot.
And in my report parametr Language is string, but  here (COALESCE((SELECT "VERSIONS"."VERSION" FROM "AKS_HSE"."DOCSADM"."VERSIONS" "VERSIONS" WHERE "VERSIONS"."DOCNUMBER"="PROFILE"."DOCNUMBER" AND "VERSIONS"."VERSION"=2), 1)) it returns int.
Can I change it  to string in SQL expression?

Author

Commented:
OOO Thanks. Everything is ok now.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial