Forum Replies Created

Viewing 15 posts - 646 through 660 (of 3,544 total)

  • RE: How to efficiently import data in .rpt format into SQL 2008

    Jeff Moden (7/23/2014)


    BCP will actually handle such trailing garbage lines quite well, BCP FORMAT File or not.

    Yes you are right Jeff 😀

    I tried several tests with the data supplied and...

  • RE: SSRS hide column

    =IsNothing(First(Fields!TOLERANCE_CHECK.Value, "NetUnitPricingReport"))

  • RE: How to efficiently import data in .rpt format into SQL 2008

    If your file ends with a 'rows affected' line or extra CRLF then AFAIK you will not be able to import using the format file as the line does not...

  • RE: How to efficiently import data in .rpt format into SQL 2008

    Jeff Moden (7/21/2014)


    Think of it as a "Unicode file prefix". It actually means something else specifically and I can't think of the precise meaning but that's mostly what it...

  • RE: How to efficiently import data in .rpt format into SQL 2008

    halifaxdal (7/17/2014)


    Msg 8114, Level 16, State 5, Line 1

    Error converting data type varchar to bigint.

    If the files were output by SSMS set to output to file then your data will...

  • RE: calculate the sum of dates minus repetitive dates

    WITH cte (cs_id,USERID,assgn_dtm,complet_dtm,diff_of_days,rownum) AS (

    SELECTcs_id,USERID,assgn_dtm,complet_dtm,DATEDIFF(dd,assgn_dtm,complet_dtm),

    ROW_NUMBER () OVER(PARTITION BY CAST(assgn_dtm as date),CAST(complet_dtm as date) ORDER BY assgn_dtm)

    FROM#temp_tbl

    WHEREcs_id = 1000090

    ANDuserid = 1000031

    )

    SELECTcs_id,USERID,

    SUM(CASE WHEN rownum = 1 THEN diff_of_days ELSE 0 END),

    SUM(2-rownum)

    FROMcte

    GROUPBY cs_id,USERID

  • RE: Script Help - Selecting last record

    sgmunson (7/11/2014)


    Turns out my last attempt was actually almost right.....

    It produces the exact result you specified.

    Nice 🙂

  • RE: Script Help - Selecting last record

    The scripts would be the T-SQL necessary to create the tables and data to test the query with, for example

    The table DDL would be like this

    CREATE TABLE PURCHLINE(PURCHID char(12),ITEMID char(6),QTYORDERED...

  • RE: Script Help - Selecting last record

    matfurrier (7/11/2014)


    friends,

    I'm grateful for all the help.

    However, all the scripts that I have tried here are returning me the same result.

    I still do not understand why the...

  • RE: Script Help - Selecting last record

    sgmunson (7/11/2014)


    ...save for the ORDER BY clause that appears just after the GROUP BY in the subquery, which doesn't need to be there and SSMS won't like it anyway...

    My bad...

  • RE: How to calculate total sum of these table

    SELECTfs_accno,

    SUM(CASE WHEN fs_cost_center = '205produ' THEN amount ELSE 0.00 END) AS [205produ],

    SUM(CASE WHEN fs_cost_center = '206produ' THEN amount ELSE 0.00 END) AS [206produ],

    SUM(CASE WHEN fs_cost_center = '208produ' THEN amount ELSE...

  • RE: Script Help - Selecting last record

    SELECT I.ITEMID AS ITEM,

    I.INVOICEID AS NF,

    I.TRANSREFID AS OC,

    RECENTES.FINALIDADE,

    CONVERT(decimal(10,2), I.COSTAMOUNTPOSTED/RECENTES.QTD) AS VALOR_RATEADO

    FROM INVENTTRANS I

    LEFT OUTER JOIN (

    SELECT PL.ITEMID, PL.PURCHID, PL.DATAAREAID, PL.DIMENSION3_ AS [FINALIDADE],

    SUM(PL.QTYORDERED) AS [QTD],

    ROW_NUMBER() OVER (

    PARTITION BY PL.ITEMID, PL.DATAAREAID,...

  • RE: how to use substring and charindex to extract desired string

    LEFT([string],LEN([string]) - CASE WHEN RIGHT([string],1)='/' THEN 1 ELSE 2 END)

  • RE: Exporting data to CSV in Month and date format

    Koen Verbeeck (7/1/2014)


    Ashif Shaikh (7/1/2014)


    no, for me the jobs is creating the output file from job- step -> advance -> output

    Ah yes, you need to use jobtokens for that.

    Use Tokens...

  • RE: Are the posted questions getting worse?

    Jeff Moden (6/30/2014)


    Eirikur Eiriksson (6/30/2014)


    jcrawf02 (6/30/2014)


    [music]Jeff sees you when you're sleeping, He knows when you're awake....[/music]

    ...he's reading all your posts

    and counting your mistakes

    so you better...

    😎

    ... sooooo, throw the packages out,

    you...

Viewing 15 posts - 646 through 660 (of 3,544 total)