null vs IS NOT NULL

  • No is the same sir, I am trying both t-sql and ssrs expression to see which one will work.

    I just attach a copy of my report so that you can best help me. in my first column

    I do not need the blank rows.

    Thanks

  • I will quote just about everyone in this thread....we really can't help you unless you provide some details. ddl and some sample data. Remember we can't see your screen and have no knowledge of your project. A bunch of 'X's in a mock report do not provide anybody else clear details about what you are trying to do. My guess is that if you post your ddl and some sample data there at least 1,000 people on this board that can help you write the query EXACTLY the way you need it in a matter of minutes. But until we get clear details we have no chance of helping you get to a solution for your problem. Please view the link in my signature for best practices on posting a question.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • WHERE (Type NOT IN ('Siu-ai', 'Subrogation', 'Siu-fi', 'SIU', 'Siu-mi')) AND (Company = 'xxx') AND ([Compliant Status] = 'xxxxx') AND

    ([Reopen ID] IS NOT NULL) AND ([Reopen ID] <> '') OR

    (Company = 'xxxxx')

  • gissah (3/16/2011)


    WHERE (Type NOT IN ('Siu-ai', 'Subrogation', 'Siu-fi', 'SIU', 'Siu-mi')) AND (Company = 'xxx') AND ([Compliant Status] = 'xxxxx') AND

    ([Reopen ID] IS NOT NULL) AND ([Reopen ID] <> '') OR

    (Company = 'xxxxx')

    This isn't information. You've given code without bothering to explain what this is from, what you expect it to do, or what doesn't work when you run this. IS this a T-SQL query or an SSRS query?

    We are willing to help, but you need to spend a little time typing and explaining what is happening.

  • hi sean i know you have good intent

  • I want the first column of the attach pdf form just to display only the cell with reopenId numbers. I don't need the blank ceels in the first column

    ([Reopen ID] IS NOT NULL) AND ([Reopen ID] <> '')

  • gissah (3/16/2011)


    hi sean i know you have good intent

    Yes again, we are willing to help. Read this article[/url] and understand what it is saying. Just reposting the same stuff over and over is not going to make it any clearer to us. Unless you post ddl and some sample data nobody is able to help you. Post the ddl, sample data, your desired output and the query that you have so far and you will get help. Until then you will be left scratching head about why these people at ssc can't help me.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • gissah (3/16/2011)


    WHERE (Type NOT IN ('Siu-ai', 'Subrogation', 'Siu-fi', 'SIU', 'Siu-mi')) AND (Company = 'xxx') AND ([Compliant Status] = 'xxxxx') AND

    ([Reopen ID] IS NOT NULL) AND ([Reopen ID] <> '') OR

    (Company = 'xxxxx')

    I suspect that the issue is with the OR in the statement. Any Company = 'xxxxx' records will be returned, regardless of a NULL value.

    The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking

  • All I want to do is to get rid of the blank rows in the reopenid column

    I have attach a sample of how I want this to be.

    I am running this report in bids with a query buider

    Thanks

  • Thank you miltman that works.

    I guess I have to create a parameter to select

    the company name.

    Thanks a lot

  • You're welcome, I'm happy I could help.

    The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking

  • gissah (3/16/2011)


    Thank you miltman that works.

    I guess I have to create a parameter to select

    the company name.

    Thanks a lot

    I don't see how a parameter will help you.

    You need to take a closer look at how you want to group your 'AND' & 'OR' statements. You are only checking for NULL on the left side of the 'OR'

  • Ok thanks, what do you suggest? I am using a query builder in bids.

    sincerely

  • I suggest that you start editing your query manually & testing the results in Management Studio. Query builders can get you only so far.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 14 posts - 16 through 28 (of 28 total)

You must be logged in to reply to this topic. Login to reply