-2

I'm not able to figure out this issue its on power builder code. I'm fetching a where clause and storing in a string variable and I'm trying to remove the last five characters i.e OR ". I'm using the below function but it is not working in Power Builder in ODBC connection but working in sybase connection. Any help is highly appreciated ? Thanks

     szClause= "fd_M.fd_term_date is null AND (fd_M.fd_incom_est_yn = 'Y' OR (EXISTS (SELECT * FROM fd_M f WHERE fd_M.fd_ref_fund = f.fd_id AND f.fd_incom_est_yn = 'Y'))) AND  (Upper(fd_M.fd_reprt_c3)='4HSJ' OR "
     szClause= Left(sClause, Len(sClause) - 5)
veedsql
  • 5
  • 5

2 Answers2

0

The obvious answer is that the last five characters of the string are ' OR, so you're trimming the closing quote at the end of '4HSJ'.

Have you tried szClause= Left(sClause, Len(sClause) - 4)?

Mike K
  • 486
  • 3
  • 7
  • Yes I tried but it is trimming more further and giving me this instead fd_M.fd_term_date is null AND (fd_M.fd_incom_est_yn = 'Y' OR (EXISTS ( – veedsql Jul 28 '15 at 07:06
0

Thanks for the response. Issue has been solved I passed wrong variable.

veedsql
  • 5
  • 5