Forum Replies Created

Viewing 15 posts - 2,041 through 2,055 (of 3,544 total)

  • RE: Seconds to dd:hh:mm:ss

    OK try this, may work better as no conversion to datetime required

    SELECT

    CAST(TS_TIME_ASSIGNED / 86400 as varchar) + ' days ' +

    CAST((TS_TIME_ASSIGNED % 86400) / 3600 as varchar) +...

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

  • RE: display row number of import file in error message

    If you are using DTSrun to execute the package (eg in a scheduled job), it will output any errors which includes the row(s) and column(s). If it is a scheduled...

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

  • RE: Seconds to dd:hh:mm:ss

    DECLARE @date datetime

    SET @date = DATEADD(second,508621,0)

    SELECT

    CAST(DATEPART(dayofyear,@date)-1 as varchar) + ' days ' +

    CAST(DATEPART(hour,@date) as varchar) + ' hour ' +

    CAST(DATEPART(minute,@date) as varchar) + ' mn...

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

  • RE: Is there a better way to ignore time portion of a smalldatetime field

    There are several threads discussing this subject and I think the concensus is that the following are the most efficient to avoid the use of CONVERT.

    CAST(DATEADD(day,DATEDIFF(day,0,@dateField),0) as smalldatetime)

    CAST(CAST(@dateField as int)...

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

  • RE: Epoch time

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

  • RE: Epoch time

    quotebut not quite the elegant minimalistic solution...

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

  • RE: Epoch time

    quoteNow do you have anything for the required formatting other than concatenation ?!?!

    STUFF(CONVERT(varchar,DATEADD(s, epochCol,'19700101'),120),1,10,CONVERT(char(10),DATEADD(s, epochCol,'19700101'),103))

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

  • RE: Epoch time

    SELECT DATEADD(s,[epochcolumn],'19700101')

    assuming that your 'Date Zero' is 01/01/1970

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

  • RE: @@DateFirst Different when scheduled

    @@DATEFIRST is dependant on the Language setting for your login, check the Language settings for the login that is running the job and the login you use for QA,  e.g.

    @@DATEFIRST...

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

  • RE: complex ORDER BY

    quoteWell, the syntax for that doesn't check out. Incorrect syntax near CASE

    Don't see why, it worked fine...

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

  • RE: complex ORDER BY

    Do you mean

    select TimeCol, DescriptionCol

    from myTbl

    order by

    case @sortBy

       when 'Time' then convert(varchar(50),TimeCol,121)

       when 'Description' then DescriptionCol

    end DESC,

    case @sortBy

       when 'Time' then DescriptionCol...

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

  • RE: Another Pivot Table

    quotewhat do you mean -> Item.Qty be repeated for a [Date]

    UNION will suppress duplicates as in...

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

  • RE: Another Pivot Table

    SELECT [Date],ItemA AS [Item],QtyA AS [Qty]

    FROM

    UNION

    SELECT [Date],ItemB,QtyB

    FROM

    UNION

    SELECT [Date],ItemC QtyC

    FROM

    How many Item's are there, is it a fixed number?

    Can Item/Qty be...

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

  • RE: Returning ADO recordset and output parameters in one stored procedure call

    quotewe tried releasing the recordset (RS = Nothing)

    Try closing the recordset (and any additional ones if...

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

  • RE: Returning ADO recordset and output parameters in one stored procedure call

    Not if the output is > 8000 bytes

    The problem is due to the consumption of the output recordsets, as in the following from MSDN

    "If a command returns a single result...

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

Viewing 15 posts - 2,041 through 2,055 (of 3,544 total)