Forum Replies Created

Viewing 15 posts - 796 through 810 (of 3,544 total)

  • RE: Query with multiple subqueries as columns with date as base reference

    Put your query in a cte and add the GROUP BY, SUM and ORDER BY to the SELECT FROM the cte

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

  • RE: .NET SSIS Script Task issue

    Dim f As New System.IO.FileInfo(FilePathName)

    f.Length 'Size in bytes of the file

    Can the file be large? Just curious why reading 1k chunks!

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

  • RE: Query with multiple subqueries as columns with date as base reference

    Add GROUP BY on site_number,site_nameentity_equipment_name and 'Date/Time' summing the three values.

    As for a better way, it depends, what is the performance currently like using real data?

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

  • RE: SQL Query - convert multiple rows and columns into single row

    SELECT

    'Type'[Type]

    ,SUM(CASE WHEN code='09' THEN Amt/100 ELSE 0 END) AS [Col1]

    ,SUM(CASE WHEN code='10' THEN Amt/100 ELSE 0 END) AS [Col2]

    ,SUM(CASE WHEN code='11' THEN Amt/100 ELSE 0 END)...

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

  • RE: Table created with “select into” sometimes does not create all the columns.

    GilaMonster (4/24/2014)


    I'd start by looking through other procedures to see if there's any which drop and recreate that table. Sounds like there might be another procedure which does a DROP...

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

  • RE: SQL Server Error 4145

    What is the text part of the error that follows the error code?

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

  • RE: Table created with “select into” sometimes does not create all the columns.

    Is there more than one procedure being used that creates the table?

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

  • RE: Weekly Best Seller

    Luis Cazares (4/24/2014)


    But this might be easier to understand for most people

    True 🙂

    Doubt there is much difference in performance anyway 😉

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

  • RE: Indicators for Yes, No, or blank

    Assuming Finished is a bit column then use this expression

    Switch(IsNothing(Fields!Finished.Value),2,Fields!Finished.Value,1,True,0)

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

  • RE: SSRS 2008 R2

    1. I believe so yes however I have never done so. You will need a separate SQL Server license though.

    2. Only R2 has the ability to name worksheet(s) via the...

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

  • RE: Joining where values do not equal one another

    SELECTp.item

    ,(p.qty_ordered-p.qty_received) as POQtyRemaining

    ,ip.item

    ,ip.qty_on_hand

    ,p.po_num

    ,p.po_line

    ,p.po_release

    ,p.stat

    ,p.qty_ordered

    ,p.qty_received

    ,p.due_date

    ,p.promise_date

    ,c.item

    ,(c.qty_ordered-c.qty_shipped) AS QtyRemaining

    ,ic.qty_on_hand

    ,c.due_date

    ,c.co_num

    ,c.co_line

    ,c.co_release

    ,c.qty_ordered

    ,c.qty_shipped

    ,c.stat

    ,c.promise_date

    ,c.co_cust_num

    FROM(VALUES

    ('1001099548','1001099550'),

    ('84162359','84198545'),

    ('84532300','84532293'),

    ('47547523','47547951'),

    ('305545A3','87433653'),

    ('87444977','87444975')

    ) l (pitem,citem)

    JOIN [Ace_App].[dbo].[poitem] p ON p.item = l.pitem AND (p.stat = 'P' or p.stat = 'O')

    JOIN [Ace_App].[dbo].[itemwhse] ip ON ip.item = p.item

    JOIN [Ace_App].[dbo].[coitem]...

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

  • RE: Problem: Execute and Save SSRS Report through Console App

    When referencing a RS report via web services use

    /foldername/reportname

    Note that the report name does not include the .rdl extension

    If you have a hierarchy of several folders then add them to...

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

  • RE: Weekly Best Seller

    Jako de Wet (4/24/2014)


    SUM(1-SIGN(Pos-1)) section returns 0 always

    Curious :ermm:

    Returned correct results when run against your test data.

    The only way you will get zero is if the product's quantity was never...

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

  • RE: Weekly Best Seller

    ;WITH cte (ProductId,Pos) AS (

    SELECT ProductId,

    RANK() OVER(PARTITION BY SaleYear,SaleWeek ORDER BY Quantity DESC)

    FROM SalesData)

    SELECT ProductId,SUM(1-SIGN(Pos-1))

    FROM cte

    GROUP BY ProductId

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

  • RE: SSRS Grouping

    Off the top of my head

    In your report create two datasets (assumes your data is in a table called data)

    First as

    ;WITH

    i (InvoiceNo) AS (SELECT InvoiceNo FROM data GROUP...

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

Viewing 15 posts - 796 through 810 (of 3,544 total)