Results 1 to 4 of 4

Thread: new line

  1. #1
    Join Date
    Sep 2010

    Unanswered: new line

    select gender,amt,age,[address],class ,

    Case when gender= '' then 'gender,'when gender is null then 'gender,' Else '' End +
    Case when amt = '' then 'amt,'when amt is null then 'amt,' Else '' End +
    Case when age = '' then 'age,'when age is null then 'age,' Else '' End +
    case when [address] = ''then 'address'when [address] is null then 'address,' else '' End +
    Case when class = '' then 'class,'when class is null then 'class,' Else '' End
    As [Error Remarks] from mytable

    The above query is used to check if any of this row is blank or null display the result in
    a column name "error remarks" .
    Now the result i m getting is :
    gender, amt, age,address,class
    all this result is displayed in a single line in a single cell.
    now i want the result to be displayed in different line:
    like this:

    all this is single cell with the above query.

    i had tried char(13) and 10 . and the value is coming in new line but in sql server textmode and not in grid mode . i want data to be in grid mode.

  2. #2
    Join Date
    Sep 2001
    Chicago, Illinois, USA
    Why are you trying to do this, this way?

    What you are trying to do is the antithesis of good design.

    Is there a very specific reason that you want the results to appear this way, or are you just expecting it to appear this way and you think something is wrong and you want to "correct" it?

    Each error record should be one record.

    What you are trying to do is make each record be anywhere from one to five records. Were you also expecting a blank "line" between each vertical representation of each error.

    Unless I am missing something, this concept is bad news.

    Maverick Software Design

    (847) 864-3600 x2

  3. #3
    Join Date
    Nov 2004
    Provided Answers: 4
    The question here is in what environment the resulting grid will be present in. If the result ends up in a browser (HTML file), you will need another delimiter than CHAR(13) + CHAR(10). You will have to use whatever delimiter that is suitable for that environment.
    Without knowledge about that, we can not help you.
    With kind regards . . . . . SQL Server 2000/2005/2012

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  4. #4
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    I'd handle this at the presentation layer as this is most definitely a presentation concern. To echo Wim, what are you using to display the results?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts