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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:40:59+00:00 2026-05-27T15:40:59+00:00

select cast(de.ApprovalOrder AS VARCHAR(32)) + cast(de.EntityCode AS VARCHAR(32)) + isnull(cast(de.DelegationCode AS VARCHAR(32)), ”) as

  • 0
select  cast(de.ApprovalOrder AS VARCHAR(32)) 
            + cast(de.EntityCode AS VARCHAR(32)) 
            + isnull(cast(de.DelegationCode AS VARCHAR(32)), '') as 'RowID' ,
            *
from    workflow.delegation_engine de
where   RowID <> NULL

When I try to execute the following I receive the error:

Msg 207, Level 16, State 1, Line 13 Invalid column name ‘RowID’.

Just wondering how I can reference this temporary column? I searched for previous postings which suggested using ‘having’ for this however that doesn’t appear to work either.

  • 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-27T15:41:00+00:00Added an answer on May 27, 2026 at 3:41 pm

    One solution would be to make a subselect of the entire statement, applying the where clause on its result

    select  *
    from    (
              select  cast(de.ApprovalOrder AS VARCHAR(32)) 
                      + cast(de.EntityCode AS VARCHAR(32)) 
                      + isnull(cast(de.DelegationCode AS VARCHAR(32)), '') as 'RowID'
                      , *
              from    workflow.delegation_engine de
            ) de 
    where   de.RowID IS NOT NULL
    

    Another solution could be to repeat the entire clause in the WHERE clause

    select  cast(de.ApprovalOrder AS VARCHAR(32)) 
            + cast(de.EntityCode AS VARCHAR(32)) 
            + isnull(cast(de.DelegationCode AS VARCHAR(32)), '') as 'RowID' ,
            *
    from    workflow.delegation_engine de
    where   cast(de.ApprovalOrder AS VARCHAR(32)) 
            + cast(de.EntityCode AS VARCHAR(32)) 
            + isnull(cast(de.DelegationCode AS VARCHAR(32)), '') IS NOT NULL
    

    Or you could test each individual field for NULL

    select  cast(de.ApprovalOrder AS VARCHAR(32)) 
            + cast(de.EntityCode AS VARCHAR(32)) 
            + isnull(cast(de.DelegationCode AS VARCHAR(32)), '') as 'RowID' ,
            *
    from    workflow.delegation_engine de
    where   de.ApprovalOrder IS NOT NULL
            AND de.EntityCode IS NOT NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do something like this: SELECT CAST(MYCHARCOL AS VARCHAR(LEN(MYCHARCOL))) FROM MYTABLE
SELECT CAST(CONVERT(varchar, W.CreateTS, 101)AS SMALLDATETIME) AS [SoldDate] ,COUNT(*) AS NumberOfWidgets ,FT.FormName FROM tblWidget W
Select cast(ltrim(rtrim(Substring(string,charindex('my',string)+len('my')+5, charindex('for the company',string)-charindex('my',string)+len('my')-9))) as datetime) from table Select cast(ltrim(rtrim(Substring(string,charindex('company',string)+len('company')+1, len(String)-charindex('company',string)+len('company')-9)))as varchar) from
I noticed that I can write SELECT CAST(Min(mynumber) AS VARCHAR(Max))+'mystring' AS X as SELECT
I have a query like this: SELECT Name, REPLACE(RTRIM(( SELECT CAST(Score AS VARCHAR(MAX)) +
if i try to cast string date to datetime like select cast('12/01/2010' as datetime)
Which of these options is more optimal? imploding in MySQL $rsFriends = $cnn->Execute('SELECT CAST(GROUP_CONCAT(id_friend)
I have an HQL statement like so: Select cast(ed.employee.employeeID as int) AS emp_id FROM
I'm trying to do this: SELECT CAST(columnName AS INT), moreColumns, etc FROM myTable WHERE
Consider this query: WITH Scores (score) AS ( SELECT CAST(score AS INTEGER) FROM (

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.