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

  • Home
  • SEARCH
  • 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 571841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:33:00+00:00 2026-05-13T13:33:00+00:00

C++Builder ADOQuery SQLServer I’m using a stored procedure with this select SELECT Name, COALESCE(

  • 0

C++Builder ADOQuery SQLServer

I’m using a stored procedure with this select

SELECT  Name,
        COALESCE(
        (
        SELECT  TOP 1 0
        FROM    TbUserParam
        WHERE   TbUserParam.ID_User = @ID_User
                AND TbUserParam.ID_Param = CfgListParIzm.ID_ListParIzm
        ), 1) Visi
FROM    CfgListParIzm
WHERE   CfgListParIzm.ID_ListGroupParIzm = @ID_ListGroupParIzm

Stuff about this query

in my query with SQL string :

FlowClientHardQ  :ID_User, :ID_ListGroupParIzm

then DataSource and DBGrid with CheckBox fields. Source

So I need a bool (or bit) field there from my ADO Query.
How / Where can I convert it ?

Thank you.

  • 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-13T13:33:00+00:00Added an answer on May 13, 2026 at 1:33 pm

    Cast to bit?

    SELECT  Name,
            CAST(
            COALESCE(
            (
            SELECT  TOP 1 0
            FROM    TbUserParam
            WHERE   TbUserParam.ID_User = @ID_User
                    AND TbUserParam.ID_Param = CfgListParIzm.ID_ListParIzm
            ), 1) as bit) Visi
    FROM    CfgListParIzm
    WHERE   CfgListParIzm.ID_ListGroupParIzm = @ID_ListGroupParIzm
    

    But can you not rewrite the query thus to avoid the subquery:

    SELECT
        C.Name,
        CAST(CASE WHEN T2.ID_Param IS NULL THEN 0 ELSE 1 END as bit) AS Visi
    FROM
        CfgListParIzm C
        LEFT JOIN
        (
        SELECT
            T.ID_Param
        FROM
            TbUserParam T
        WHERE
            T.ID_User = @ID_User
        ) T2 On T2.ID_Param = C.ID_ListParIzm
    WHERE
        C.ID_ListGroupParIzm = @ID_ListGroupParIzm
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using application builder and setting up select boxes to populate a query
In Flash builder, I'm struggling with basics of data retrieval from local database. Using
I'm using Flash Builder to build an AIR android app. To prevent the app
I'm using Flash Builder 4.6 to make an iOS app.. It's going fairly well,
I'm using Flash builder 4.6 for mobile applications. I need to drag an image
Using the interface builder in my storyboard, I put a Bar Button Item in
using Interface Builder and Storyboared, I built UITabBarController with 3 views. By default, when
We currently use Report Builder with ColdFusion. This Report Builder hasn't seen any Adobe
Using report Builder 7.x I am trying to format a TDBText to display postive
builder.RegisterFilterProvider(); This can inject a property in filter write on an action like: [TestFilter]

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.