Forum Replies Created

Viewing 15 posts - 301 through 315 (of 1,183 total)

  • RE: Crystal Reports - Which version?

    I'll go ahead and add my 2 cents here too. SSRS is much more intuitive. This is only my personal opinion, but I go running and screaming out of the...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: size limitation for dynamic SQl query

    NVARCHAR(MAX)

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: What should I be doing with my points?

    On a serious and slightly related note. Years ago, I believe sometime around 2005, Steve and Red Gate gave out free copies of SQL Prompt for the "top posters" in...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: error in select when converting to number and compare

    No need to CAST.

    SELECT

    NAME, LASTNAME,

    CASE WHEN AGE > 25 THEN '1' ELSE '' END AS QUALIFIED

    FROM

    TABLE1

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    Then use your method of

    LEFT(rowid,charindex('.',rowid)-1)

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    use a subquery ....

    select

    floor(rowID) as trunk

    ,max(Availability)

    from (select

    rowid,

    sum(case when [status] like '%in-service%' then 1 else 0 end)

    / (count(*)*1.) as Availability -- the *1. is to force conversion to numeric

    from...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    as long as we force one of the two values to numeric. without my parentheses, it was forcing the convert AFTER the division. :hehe:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    Sorry, I missed the parentheses around the *1.

    select

    rowid,

    sum(case when [status] like '%in-service%' then 1 else 0 end)

    --/ (count(*)*1.) as Availability -- the *1. is to force conversion to...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    PHXHoward (4/28/2011)


    I have a long list of devices and need to know the availability for each of them.

    how are they to be grouped? by device type, device name, etc ....

    Post...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    If rowID is what it seems to be, unique for each row, then you'll need to remove rowID completely from the SELECT and GROUP BY

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    For clarification: Don't think of this as a count from two queries. You are querying one table, one time and performing an aggregate depending on the values in that table....

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Counts from two queries

    select

    rowid,

    sum(case when [status] like '%in-service%' then 1 else 0 end)

    / count(*)*1. as Availability -- the *1. is to force conversion to numeric

    from CustomPollerStatistics_Detail

    group by rowid

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Distinct combinations for a group

    Funny, this is almost identical to this question. Is this homework?

    At any rate, your answer can be found here.

    http://www.sqlservercentral.com/Forums/Topic1094079-392-1.aspx#bm1094158

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: What should I be doing with my points?

    Judging from some people's anger level at question semantics, the points are worth more than a gallon of gas. :hehe:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: T SQL Trigger on certain columns

    If you wrap the trigger code in an IF statement, you can at least have the trigger "do nothing" unless the specified column is updated.

    As in ...

    IF UPDATE(columnName)

    BEGIN

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 301 through 315 (of 1,183 total)