Forum Replies Created

Viewing 15 posts - 556 through 570 (of 3,543 total)

  • RE: Get ProductConfig With Lowest Prise

    sm_iransoftware (2/17/2015)


    Thank you all

    And

    Thank you David Burrows

    I didnot Know Row_Number() Befor this.

    Actually ROW_NUMBER was introduced with 2005, you might want to check out the other windowing functions as well, 2014...

  • RE: Get ProductConfig With Lowest Prise

    Using row number

    SELECT ProductId,ProductConfigId,Amount AS [MinPrice],HasGift

    FROM (SELECT p.ID AS [ProductId],c.ID AS [ProductConfigId],a.Amount,c.HasGift,

    ROW_NUMBER() OVER (PARTITION BY p.ID ORDER BY a.Amount ASC) AS [RowNum]

    FROM dbo.TBL_Product p

    JOIN dbo.TBL_ProductConfig c ON c.ProductId = p.ID

    JOIN...

  • RE: Showing Child values in one column from the same table

    CREATE TABLE dbo.Person (PersonID int,FirstName varchar(20),LastName varchar(20))

    CREATE TABLE dbo.Relation (RelationID int,BossID int,SlaveID int)

    INSERT dbo.Person VALUES (1,'Bob','Patel'),(2,'Lun','Smith'),(3,'Julie','Taylor'),(4,'Chris','Pain'),(5,'Joe','Bloggs')

    INSERT dbo.Relation VALUES (1234,1,3),(321,3,3),(231,1,5)

    SELECT p.PersonID,p.FirstName,p.LastName,

    STUFF((SELECT ',' + Name

    FROM (SELECT DISTINCT s.FirstName + ' ' +...

  • RE: How to return top n and sum up the rest

    Just for fun 😀

    SELECT ISNULL(Category,'Total') AS [Category],SUM(Column1) AS [Total]

    FROM MyTable

    GROUP BY Category

    WITH ROLLUP

    HAVING Category IS NULL OR Category IN ('Category1','Category2','Category3','Category4')

    ORDER BY GROUPING(Category) ASC,Category ASC

  • RE: How to return top n and sum up the rest

    Hint: Use CASE statement for Category and use it in GROUP BY

  • RE: Condtional action.

    Glad you solved it 🙂

  • RE: Condtional action.

    Ooops my bad, I was testing using Value

    Why are you using UniqueName, is the report using a cube?

    If you put the expression Nazwa pomiaru.UniqueName in another textbox do you get...

  • RE: Condtional action.

    I'm on SQL2008R2 and it work for me

    What version are you on?

  • RE: Won't convert to decimal

    OK but like I said it stops inserting before the first record and I presume it's to do with the characters in the field of the first row.

    But we cannot...

  • RE: Won't convert to decimal

    Check the XML for hidden characters as this would stop the implicit decimal conversion

  • RE: Condtional action.

    Try

    Switch(Fields!Nazwa_pomiaru.UniqueName = "regulacji", "IRSRZGD", Fields!Nazwa_pomiaru.UniqueName = "tryb", "IRSRZGD", True, Nothing)

    although I think this will work as well

    IIf(Fields!Nazwa_pomiaru.UniqueName = "regulacji" OR Fields!Nazwa_pomiaru.UniqueName = "tryb", "IRSRZGD", Nothing)

  • RE: ssrs expression to find count of records which falls beween two dates

    Sum(IIf(DateDiff(DateInterval.Day,Fields!SubmittedDate.Value,Today)>=31 AND DateDiff(DateInterval.Day,Fields!SubmittedDate.Value,Today)<=60,1,0))

  • RE: Anyone tried "DBA Job Interview Question & Answer Kit"?

    Jeff Moden (1/31/2015)


    It broke my heart during an interview the other day. Some guy had all the right qualities to be a perfect fit for the team but we...

  • RE: Need assistance with Update Query

    Brian Hibbert (2/1/2015)


    Try using the FROM clause in the UPDATE statement instead of a select. The right side of the SET = should be your CASE statement, but you...

  • RE: ssrs expression to find count of records which falls beween two dates

    Try

    =Sum(IIf(DateDiff(DateInterval.Day,Fields!SubmittedDate.Value,Today)<=30,1,0))

Viewing 15 posts - 556 through 570 (of 3,543 total)