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 867719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:01:34+00:00 2026-05-15T10:01:34+00:00

I have the following query. I need Description to be set to the value

  • 0

I have the following query. I need Description to be set to the value of the long statement in the middle – the part beginning with CONVERT and ending with [Description]. The query I have now runs but the value of Description in the result is always NULL. Any ideas?

select s.SectionId, 
    s.Academic_Year [AcademicYear],
    s.Academic_Term [AcademicTerm],
    s.Academic_Session [AcademicSession],
    s.Event_Id [EventId],
    s.Event_Sub_Type [EventSubType],
    s.Section [Section],
    s.Event_Long_Name [EventLongName],
    e.Description [EventDescription],
    CONVERT(varchar(MAX), S.DESCRIPTION) 
        + '<br /><br /><a href="http://www.bkstr.com/webapp/wcs/stores/servlet/booklookServlet?bookstore_id-1=044&term_id-1=' 
        +   CASE S.ACADEMIC_TERM 
            WHEN 'SPRING' THEN 'SPRING' 
            WHEN 'SUMMER' THEN 'SUM' 
            WHEN 'FALL' THEN 'FALL' 
            WHEN 'J TERM' THEN 'J TERM'
            ELSE 'ADV'
            END 
            + S.ACADEMIC_YEAR + '/' + 
            CASE S.ACADEMIC_SESSION
            WHEN '01' THEN '1' 
            WHEN '02' THEN '2' 
            WHEN '03' THEN '3' 
            END 
            + '&div-1=HILB&dept-1=' + SUBSTRING(S.EVENT_ID, 1, CHARINDEX(' ', S.EVENT_ID) - 1) + '&course-1=' + SUBSTRING(S.EVENT_ID, CHARINDEX(' ', S.EVENT_ID) + 1, 
            LEN(S.EVENT_ID)) + '&section-1=' + CONVERT(varchar(2), S.SECTION) + '" target=' + '"_blank">View Book Information</a>' [Description],
    cest.Medium_Desc [SubTypeDescription],
    s.Credits [Credits],
    cge.Medium_Desc [GeneralEd],
    s.Start_Date [StartDate],
    s.End_Date [EndDate],
    s.Max_Participant [MaximumParticipants],
    s.Adds [AddCount],
    s.Wait_List [WaitlistCount],
    s.Sec_Enroll_Status [EnrollmentStatus],
    o.Org_Name_1 [CampusName],
    cp.Medium_Desc [ProgramDescription],
    cc.Medium_Desc [CollegeDescription],
    cd.Medium_Desc [DepartmentDescription],
    ccm.Medium_Desc [CurriculumDescription],
    ccl.Medium_Desc [ClassLevelDescription],
    nt.Nontrad_Med_Name [NonTraditionalDescription],
    cpn.Medium_Desc [PopulationDescription],
    case s.Other_Org when 'N' then 0 else s.Other_Org_Part end as [CampusOtherLimit],
    case s.Other_Program when 'N' then 0 else s.Other_Program_Part end as [ProgramOtherLimit],
    case s.Other_College when 'N' then 0 else s.Other_College_Part end as [CollegeOtherLimit],
    case s.Other_Department when 'N' then 0 else s.Other_Dept_Part end as [DepartmentOtherLimit],
    case s.Other_Curriculum when 'N' then 0 else s.Other_Curric_Part end as [CurriculumOtherLimit],
    case s.Other_Class_Level when 'N' then 0 else s.Other_CLevel_Part end as [ClassLevelOtherLimit],
    case s.Other_NonTrad when 'N' then 0 else s.Other_NonTrad_Part end as [NonTraditionalOtherLimit],
    case s.Other_Population when 'N' then 0 else s.Other_Pop_Part end as [PopulationOtherLimit],
    s.Other_Org_Add as [CampusOtherRegistered],
    s.Other_Program_Add as [ProgramOtherRegistered],
    s.Other_College_Add as [CollegeOtherRegistered],
    s.Other_Dept_Add as [DepartmentOtherRegistered],
    s.Other_Curr_Add as [CurriculumOtherRegistered],
    s.Other_CLevel_Add as [ClassLevelOtherRegistered],
    s.Other_Nontrad_Add as [NonTraditionalOtherRegistered],
    s.Other_Pop_Add as [PopulationOtherRegistered],
    case s.Registration_Type when 'TRAD' then 0 else 1 end as [IsConEd],
    cat.Medium_Desc [TermDescription],
    cas.Medium_Desc [SessionDescription],
    s.Credit_Type [DefaultCreditType],
    cct.Medium_Desc [CreditTypeDescription]
    from sections s
    left join code_eventsubtype cest on cest.code_value_key = s.event_sub_type
    left join code_generaled cge on cge.code_value_key = s.general_ed
    left join event e on e.event_id = s.event_id
    left join organization o on o.org_code_id = s.org_code_id
    left join code_program cp on cp.code_value_key = s.program
    left join code_college cc on cc.code_value_key = s.college
    left join code_department cd on cd.code_value_key = s.department
    left join code_curriculum ccm on ccm.code_value_key = s.curriculum
    left join code_classlevel ccl on ccl.code_value_key = s.class_level
    left join nontraditional nt on nt.nontrad_program = s.nontrad_program
    left join code_population cpn on cpn.code_value_key = s.population
    left join code_acaterm cat on cat.code_value_key = s.academic_term
    left join code_acasession cas on cas.code_value_key = s.academic_session
    left join code_acacredittype cct on cct.code_value_key = s.credit_type
  • 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-15T10:01:34+00:00Added an answer on May 15, 2026 at 10:01 am

    One of your inputs must be NULL.

    You can probably solve this by identifying which it is and using COALESCE or ISNULL:

    COALESCE(x, '')
    ISNULL(x, '')
    

    COALESCE is the standard ANSI way, ISNULL gives slightly better performance (although the difference is probably insignificant in most cases).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Query and i need the query to fetch data from
i have the following query to list the employees of two table. i need
I have the following query. It works just fine but I need to pull
I need a query which can do the following operation. I have a table
I have the following INSERT statement: INSERT INTO [StoreTestDB].[dbo].[KitItem] ([KitItemGUID] ,[KitGroupID] ,[Name] ,[Description] ,[PriceDelta]
I have following query and data saved in a MySQL database with a timestamp
I have following query which take more than a minute to execute, how can
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER
I have the following query: select column_name, count(column_name) from table group by column_name having
I have the following query: SELECT c.* FROM companies AS c JOIN users AS

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.