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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:17:52+00:00 2026-06-18T23:17:52+00:00

I am using following SELECT statement for Gridview: SelectCommand=SELECT ID, Date, Train, I_R, Dir_Ind,

  • 0

I am using following SELECT statement for Gridview:

  SelectCommand="SELECT ID, Date, Train, I_R, Dir_Ind, Detn, Rly, DiV, Loco, Shed, locoClass, loco_type,
(maj_sch_type + ','+ ' ' + maj_sch_place +',' +' '+ (CAST(maj_sch_dt as VARCHAR(11)) + ' '+'/' 
+ ' ' + min_sch_type +',' + ' ' + min_sch_place + ',' + ' '+(CAST(min_sch_dt as VARCHAR   (11))) ))    as "major",
 Equipt, I_R, reason 
 FROM PunctualityMain Order by Date ASC"

With the above, I am getting results in single cell from 6 (3 + 3) different fields of SQL data as

 POH, KPA, Jan 2 2012 / IB, Shed, Apr 18 2012

Issue is this that whenever data in any group of 3 fields (before or after ‘/’) is blank, Gridview cell is remain completely blank. If both group of fields having data than Gridview dispaly is OK as mentioned above. Can SELECT statement be modified for showing data in Gridview with any one group of fields are empty?

  • 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-06-18T23:17:54+00:00Added an answer on June 18, 2026 at 11:17 pm

    If you try to concatenate a null string with a non-null string, the result will be null.

    Select NULL + 'test' 
    

    this will return NULL.

    Also, I think your code didn’t copy paste extremely well into your question, but you need to use the ISNULL() function. I think you can get the point. You’ll probably have to clean up the code a bit for it to run. Just wrap every field that you are concatenating with ISNULL(MyField, ”)

    SELECT 
        ID, 
        Date, 
        Train, 
        I_R, 
        Dir_Ind, 
        Detn, 
        Rly,    
        DiV, 
        Loco, 
        Shed, 
        locoClass, 
        loco_type,
        (isnull(maj_sch_type, '') + ', ' + isnull(maj_sch_place, '') +', '+ (isnull(CAST(maj_sch_dt as VARCHAR(11), '')) + ' / ' + isnull(min_sch_type, '') +', ' + isnull(min_sch_place, '') + ', '+ (isnull(CAST(min_sch_dt as VARCHAR   (11)), '')) ))    as "major",
         Equipt, 
        I_R, 
        reason 
     FROM PunctualityMain 
     Order by Date ASC
    

    Reference

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

Sidebar

Related Questions

I am using the following statement; SELECT RESV_ID, BOOKING_CUS_ID, ACC_ID, (SELECT F.FLI_PRICE FROM FLIGHT
I have a problem creating the following SQL Statement using LINQ & C# select
Using MYSQL I would like to refactor the following SELECT statement to return the
I have the following select statement that I am using as a standard report:
I'm using the following SQL-Statement: SELECT Col1, count(*) as Col2, Col3 FROM table1 WHERE
I am using following for select statement with case. The column to which the
I'm using the following statement SELECT TOP 5 rootcause, COUNT(IIF(accountability=Team 1,1,0)) FROM MOAQ WHERE
I'm using the following SQL statement: SELECT SUM(t.Points) AS `Points`, CONCAT(s.Firstname, , s.Surname) AS
I am using the following statement: query_str='SELECT :NEW.FIRST_NAME||:NEW.LAST_NAME INTO HostID FROM INPUT_TABLE WHERE INPUT_ID='
I'm using the following SQL statement: SELECT reply.id, reply.content, author.username FROM thread, reply, author

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.