ready2drum Posted December 3, 2009 Share Posted December 3, 2009 I've tried to tweak the code below to get the query to execute without any errors, but I keep getting these types of errors about 'incorrect syntax' near the '|'.See code below: SELECT fac.facility, fac.catalog_id, fac.q_level, RTRIM(' dst.COST_CENTER_CHARGE ') || '-' || RTRIM(' dst.ACTIVITY_ID ') || '-' || RTRIM(' dst.ACCOUNT_NBR ') | | CASE WHEN dst.SUB_ACCOUNT_NBR >' ' THEN '-' || RTRIM(' dst.SUB_ACCOUNT_NBR ') ELSE '' END COST_CENTER_CODE FROM tidcafac fac inner JOIN tidacdst dst ON fac.a_xref_code = dst.a_xref_code WHERE fac.facility = 'MAX' Any suggestions/feedback on what I'm missing in the query is much appreciated!Thanks! Link to comment Share on other sites More sharing options...
thescientist Posted December 3, 2009 Share Posted December 3, 2009 it looks like there is a space in between the |'s after the ACCOUNT_NBR line Link to comment Share on other sites More sharing options...
ready2drum Posted December 4, 2009 Author Share Posted December 4, 2009 I removed the space between the '| |', but still get the same error message....it has to be something really minor that my eyes just aren't catching...what could it be? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 4, 2009 Share Posted December 4, 2009 Try to figure out which line it's complaining about. Does that operator belong in this line:CASE WHEN dst.SUB_ACCOUNT_NBR >' ' THEN '-' || RTRIM(' dst.SUB_ACCOUNT_NBR ') ELSE '' END COST_CENTER_CODE Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.