Forum Replies Created

Viewing 15 posts - 871 through 885 (of 3,544 total)

  • RE: SELECT question

    Jeff Moden (12/10/2013)


    [font="Arial Black"]Personally, I'd like to know why in the hell anyone would be storing SSNs in plain text![/font]

    Are you assuming combo = combination = concatenation 😀

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Conditoinal Formatting on Percent Field Not Working

    It is because switch works with expression/object pairs, you need to write it like this

    =SWITCH(SUM(Fields!MyVal.value) > .95, "Green", True, "Red")

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Page Header Issue

    Branch should be your top group and have new page set and put Branch in your page header.

    You only need child groups if your are aggregating at those levels or...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Full Text Index / Contains

    Juul van Iersel (12/10/2013)


    Hi David,

    Thanks for your reply.

    Your solution won't work, I'm affraid, because @Criteria1 applies to Column1, and @Criteria2 applies to Column2. When one of the @Criteria parameters is...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Full Text Index / Contains

    Lowell (12/10/2013)


    wouldn't switching to a union work, i think? i think the AND would short circuit any table scan right away, and will perform a bit better.

    SELECT

    *

    FROM ...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Full Text Index / Contains

    This is one of those 'it depends'

    Doing two separate queries is not necessarily worse than one, I have in the past done two and found no problem with performance,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: select sum problem

    ;WITH cte (phone,[month],value) AS (

    SELECTphone,

    CASE WHEN dekabr = 0 THEN 1

    WHEN noyabr = 0 THEN 2

    WHEN oktyabr = 0 THEN 3

    ELSE 4

    END,

    CASE WHEN dekabr = 0 THEN yanvar

    WHEN noyabr =...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: how to calculate min and max datetime ?

    SELECT FullName,MIN(event_date) AS [LOGIN_time] ,MAX(event_date) AS [LOGOUT_time]

    FROM Events

    WHERE event_date >= '20131207'

    AND event_date < DATEADD(day,1,'20131212')

    GROUP BY FullName

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Sales Report with Up-Down Indicator

    ;WITH cte (FromID,ToID,SalesIndicator,GroupNO) AS (

    SELECT t1.ID,t2.ID,CASE WHEN t1.Sales < t2.Sales THEN 'UP' ELSE 'Down' END

    ,t1.ID-ROW_NUMBER() OVER (PARTITION BY CASE WHEN t1.Sales < t2.Sales THEN 'UP' ELSE 'Down' END...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: executing dynamic sql string

    Sigerson (12/6/2013)


    Lowell,are those brackets a problem or not?

    Nope, no problem.

    If you script anything or use the shortcut menu to execute a procedure in SSMS it puts brackets around everything.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQLServerCentral apologizes and you can win a book

    Nice! 😀

    Query to show lowest date for a key where date as more than five entries

    ;WITH Test (SomeKey,SomeDate,RowNo)

    AS (

    SELECTSomeKey,SomeDate

    ,ROW_NUMBER() OVER (PARTITION BY SomeKey ORDER BY SomeDate ASC)

    FROMSomeTable

    GROUPBY SomeKey,SomeDate

    HAVINGCOUNT(*) > 5

    )

    SELECTSomeKey,SomeDate

    FROMTest

    WHERERowNo...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Advise needed

    halifaxdal (12/4/2013)


    are you suggesting adding each milestone to the new table?

    That would be my understanding.

    You could add other attributes to the table (eg name of person who comppleted the milestone)

    You...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Advise needed

    Richard Warr (12/4/2013)


    I'd go for the redesign as well. It's not a major one.

    Take out the Workflow field from the Project table and have another table called ProjectWorkflow which would...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SSRS Subscription - Which User Set it Up?

    Use a login that has admin rights set for the Report Server and check the Subscription for the Report, the Owner is the login that created the Subscription

    Otherwise

    Find the subscription...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Advise needed

    You could use bit locations of the int to store each status

    ie Draft=1, Saved=2, Submitted=4, Returned=8, LARReviewed=16, LARSignedOff=32, SCRReviewed=64, SCRSignedOff=128

    So a value of 36 would be Submitted and LARSignedOff=32 (4+32)

    I...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 871 through 885 (of 3,544 total)