Forum Replies Created

Viewing 15 posts - 1,381 through 1,395 (of 3,957 total)

  • RE: Convert DD MMM YYYY to yyyymmdd in string

    dc.pc100 (9/30/2013)


    How or where would i add the below

    Where [SourceData] like '%[0-9]%' + 'Jan' + '[0-9]%'

    as lots of data gets messed up with dwains code

    e.g

    Destination File Name....sourcedata2

    20130616.xlsx..............0616.xlsx

    201307.xlsx.................07.xlsx

    HSE.201306.xlsx...........HSE.06.xlsx

    HSE.201307.xlsx...........HSE.07.xlsx

    2013 ICT Calendar.xls....ICT...

  • RE: how to update column city value from 'A' to 'B' and 'B' to 'A' in single query

    T.Ashish (9/29/2013)


    I have faced the same situation in an interview where interviewer asked me a question on triggers.

    I tried my hard to convince him that we...

  • RE: Convert DD MMM YYYY to yyyymmdd in string

    I find it interesting because I'm into self-flagellation and because it seems that all of the date formats you've included in your filenames CAST cleanly to a DATE data type,...

  • RE: Convert DD MMM YYYY to yyyymmdd in string

    Running the code you quoted Jeff, I get these results.

    sourcedata ...

  • RE: Returning related records from the same table

    If you're trying to unchain a sequence of part numbers using a parentID like this, you may want to look at using a recursive CTE to resolve the hierarchy.

    Something like...

  • RE: Convert DD MMM YYYY to yyyymmdd in string

    Ok. This should work.

    But someone I'm sure will probably come up with a better way.

    WITH SampleData (sourcedata) AS

    (

    SELECT '12 Jan 2013 Test.docx'

    ...

  • RE: Convert DD MMM YYYY to yyyymmdd in string

    Post retracted. Hang on for a replacement.

  • RE: query issue

    Like Luis suggested, can't you just do a GROUP BY?

    SELECT RunDate, FiscalYear, PP, Port

    ,OilPrice=MAX(OilPrice)

    ,GasPrice=MAX(GasPrice)

    FROM @t1

    GROUP BY RunDate, FiscalYear, PP, Port

    Based on LinksUp's...

  • RE: Rolling 3 month average cost help

    Briceston (9/29/2013)


    First, thank you for replying. How are you deriving your average cost figures?

    I included the intermediate cost and members columns so you could see that. Each is the...

  • RE: ORDER BY clause based on values IN ()

    Sean Lange (9/27/2013)


    Dwain, I think this should produce the same result?

    SELECT field1, field2, field3

    FROM table

    JOIN dbo.DelimitedSplit8K(@UsersEntry, ',') s ON field1 = s.item

    ORDER BY s.ItemNumber;

    I believe that it most certainly...

  • RE: Extended Properties Introduction

    Knut Boehnert (9/27/2013)


    dwain.c (9/27/2013)


    Maddave (9/27/2013)


    dwain.c (9/26/2013)


    I love extended properties. Very comprehensive introductory article!

    The only think I find annoying about them (unless I missed something) is that you can't update...

  • RE: Problem with writing a query. Kindly guide...

    T.Ashish (9/27/2013)


    Thanks Dwain.C

    Kindly ignore my earlier post, I missed it completely. Actually, Other four solutions are giving accurate results

    My results goes as below:

    1.hunchback

    WITH C1 AS (SELECT Shift FROM test12...

  • RE: Can You make this code Shorter??..

    enriquezreyjoseph (9/27/2013)


    EXEC sp_executesql @SqlQuery, N'@statusID=@statusID, @sexID=@sexID, @firstname=@firstname, @middlename=@middlename, @lastname=@lastname' -- one for each of your filters

    ,@sexID=@sexID

    ...

  • RE: Extended Properties Introduction

    Maddave (9/27/2013)


    dwain.c (9/26/2013)


    I love extended properties. Very comprehensive introductory article!

    The only think I find annoying about them (unless I missed something) is that you can't update them. Need...

  • RE: Can You make this code Shorter??..

    enriquezreyjoseph (9/27/2013)


    this is it

    Never seen that error but it looks like it is complaining about the typing of one of the parameters to your SP.

Viewing 15 posts - 1,381 through 1,395 (of 3,957 total)