Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6631387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:32:20+00:00 2026-05-25T22:32:20+00:00

New to SQL, so please accept my apologies. A query was created that when

  • 0

New to SQL, so please accept my apologies. A query was created that when

If HBL_CLNT_CAT._HS_EB_CODE1 = 'BF' then value = TBM_BILLGRP._HS_EB_DET1
If HBL_CLNT_CAT._HS_EB_CODE2 = 'BF' then value = TBM_BILLGRP._HS_EB_DET2

However of the _HS_EB_DET# exceeds 100 characters add a ‘*’.

With assistance a query was developed, however it broken the condition rules in that the ‘then statement/action would fail because it was greater number than the condition statement (select _hs_eb_code1 from hbl_cat where hs_eb_code = 'bf' that returns only 1 record).

select
  case when len(format) > 100
       then left(format, 100) + '*'
       else format 
 end as format
from
  ( select 
      case when exists ( select _hs_eb_code1
                         from hbl_cat 
                         where hs_eb_code = 'bf'
                       )
           then tbm_bllgrp._hs_eb_det1 
      end
   ) as format 
     from tbm_bllgrp 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:32:21+00:00Added an answer on May 25, 2026 at 10:32 pm

    Formatting the code would have helped you find the error. Try this:

    select
      case when len(format) > 100
           then left(format, 100) + '*'
           else format 
      end as format
    from
      ( select 
          case when exists ( select _hs_eb_code1
                             from hbl_cat 
                             where hs_eb_code = 'bf'
                           )
               then tbm_bllgrp._hs_eb_det1 
          end as format 
         from tbm_bllgrp 
      ) as tmp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to the world of ASP.NET and SQL server, so please pardon
I am writing some new SQL queries and want to check the query plans
I am totally new to SQL . I have a simple select query similar
I am a new with T-SQL. So, please help me to write the sql.
I am new to VBScript. Can someone please help me to connect to SQL
I am new to SQL.I have a database of mac-addresses which i created using
I am new to SQL server, please can any body help me out how
I am new to sql so please bear with me here. I have two
I am new to sql and programming so please bear with me. Is there
I'm new in WPF and I'd like to visualize data from SQL query to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.