Jump to content

Incorrect Syntax Near '|', Ms Sql Server, Error: 102


Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...