Forum Replies Created

Viewing 15 posts - 811 through 825 (of 3,544 total)

  • RE: SSRS 2008 R2

    Use a browser to connect to the Report Server (http://servername/Reports/)

    Click on folder containing the DataSource

    Click on the DataSource

    This will show the connection properties

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

  • RE: How to convert nvarchar to date data type?

    ;WITH c (current_week,fromdate,todate) AS (

    SELECT current_week,CAST(LEFT(current_week,10) as date),CAST(RIGHT(current_week,10) as date)

    FROM #mytable

    )

    SELECT DISTINCT c.current_week,n.current_week AS [next_week]

    FROM c

    JOIN c n ON DATEADD(day,-8,SYSDATETIME()) BETWEEN n.fromdate and n.todate...

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

  • RE: Connecting other sql server database from sql query

    Grant Fritchey (4/23/2014)


    Another way to do it is to use OPENQUERY. There are examples at the link.

    Or OPENROWSET as referenced at the bottom of the link 🙂

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

  • RE: SSRS 2008 R2

    1. The Report Server must be able to open a SQL Connection to the SQL Server

    (I assume this is OK as you can run the report...

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

  • RE: SQL/SRSS Newbie Assistance Needed :)

    richardgregory06 (4/23/2014)


    I"m still a bit confused which is typically the "Best Practice" to where I should put the criteria

    It depends!

    Check which method yields the best performance.

    p.s.

    Which is better

    asking SQL Server...

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

  • RE: Need a logic

    1. You have anerror in your keyword table, both 'already' and 'Deactivated' have id=1

    2. Like will not work as 'activated' keyword will find 'activated' and 'Deactivated'

    Solution using splitter

    SELECT m.[Description]

    FROM...

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

  • RE: Need to un-pivot some columns, pivot one column

    SELECT t.CampusID,t.Campus,t.TermID,t.Term,t.StudentID,t.Qualification,t.Programme,s.Status

    FROM [dbo].[MyTable] t

    CROSS APPLY (

    VALUES

    ('Repeat1stYear',t.Repeat1stYear)

    ,('Repeat2ndYear',t.Repeat2ndYear)

    ,('Repeat3rdYear',t.Repeat3rdYear)

    ,('ProgTo2ndYear',t.ProgTo2ndYear)

    ,('ProgTo3rdYear',t.ProgTo3rdYear)

    ,('ProgToCompleteQual',t.ProgToCompleteQual)

    ,('NotReturn2ndYr',t.NotReturn2ndYr)

    ,('NotReturn3rdYr',t.NotReturn3rdYr)

    ,('NotReturn4thYr',t.NotReturn4thYr)

    ) s (Status,StatusValue)

    WHERE s.StatusValue = 1

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

  • RE: Set value based on previous row

    ;WITH a (ID,ImportGroup) AS (

    SELECTc.ID,ROW_NUMBER() OVER (ORDER BY c.ID)

    FROM@data c

    LEFT JOIN @data n ON n.ID = c.ID + 1

    WHERE(c.EventTypeID IN (1,2,4) AND n.EventTypeID in (0, 3))

    OR(c.EventTypeID IN (0, 3) and...

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

  • RE: split big query into two different query using global temp table

    After just perusing the query I do not think you will be able to split it in two, it is too large.

    Even after replacing tab and crlf with space and...

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

  • RE: Not Able to Get 2 Decimal Places to Show When Decimal Place Value is 0

    miles_lesperance (4/11/2014)


    That worked!! That expression was written by a previous developer, and I was trying to modify it to get rid of the divide by zero error that would occur....

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

  • RE: Assigning Batchid to Cake Making Process

    sunil.mvs (4/11/2014)


    Cake can have x steps and it depends on customer request .. Once work flow starts it starts with 1 and reaches nth...

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

  • RE: Not Able to Get 2 Decimal Places to Show When Decimal Place Value is 0

    use this expression

    =IIF(Sum(CDec(Fields!Field2.Value))=0,0,Sum(CDec(Fields!Field1.Value))/IIF(Sum(CDec(Fields!Field2.Value))=0,1,Sum(CDec(Fields!Field2.Value))))

    and set the format to P2

    *Edited to include CDec

    You should change your code to not use strings for numeric input

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

  • RE: Are the posted questions getting worse?

    GilaMonster (3/24/2014)


    It's probably nothing more than a case of "Why's the <app which has been working for years> not working? What do you mean 'who's the administrator'? We've never needed...

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

  • RE: Reg -Joins

    If you are using ID for the join you will get a Cartesian result.

    How do you know which row in table b belongs to each row in table a?

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

  • RE: SQL for adding flags depending on criteria

    ;WITH cte (CustId,OrderId,OrderDate,RowNumber) AS (

    SELECT CustId,OrderId,OrderDate

    ,ROW_NUMBER() OVER (PARTITION BY CustId,YEAR(OrderDate),MONTH(OrderDate) ORDER BY YEAR(OrderDate),MONTH(OrderDate))

    FROM

    )

    SELECT CustId,OrderId,OrderDate,SIGN(RowNumber)-SIGN(RowNumber-1) AS [CountUnique]

    FROM cte

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

Viewing 15 posts - 811 through 825 (of 3,544 total)