Forum Replies Created

Viewing 15 posts - 1,276 through 1,290 (of 2,007 total)

  • RE: delete duplicate record

    Since this post seems to not want to die, here's an update of the test script I posted before to include the unique solutions posted since.

    BEGIN TRAN

    --1,000,000 Random rows of...

  • RE: Snack Attack

    Thai Chilli Rice Crackers plus Mountain Dew for me

  • RE: Derived Table Help

    methexis (11/25/2011)


    Okay I hope I followed the rules on this!

    So the result should look something like this

    1234 CompanyX US 0.5

    1234 CompanyX EU 0.5

    4321 ...

  • RE: Derived Table Help

    methexis (11/25/2011)


    That didnt do it...damn it!

    The error I am guessing is here

    SUM (a.Pass/(COUNT (ACCGRPNUM))) as RATE

    using the ACCGRPNUM to get the total number of locations by Region kicks...

  • RE: Distinct-tify TWO columns into ONE column

    rktn_odin (11/24/2011)


    LutzM (11/24/2011)


    SELECT Date2 AS DateOutput FROM YourTable ??

    It's most probably not the code you're looking for, but it's a valid solution based on your sample data... You might want...

  • RE: Landing My First Job

    Ninja's_RGR'us (11/23/2011)


    Dev (11/23/2011)


    (XYZ is still waiting for thanks :hehe:).

    The most prolific poster post because it's the RIGHT thing to do. Not to get anything of any kind...

  • RE: How to get records in groups

    SameerKKhan (11/25/2011)


    hello again,

    i have one more query.Can i get the Date and Hour using a Query.

    I want to Insert the Date along with the hour part in the Table.Like...

  • RE: How to get records in groups

    SameerKKhan (11/25/2011)


    hello again,

    i have one more query.Can i get the Date and Hour using a Query.

    I want to Insert the Date along with the hour part in the Table.Like...

  • RE: Derived Table Help

    Off the bat it looks like you're missing a GROUP BY (formatted you code below)

    USE DQ_RefData

    -- Calculate %--

    SELECT ACCGRPNUM, ACCGRPNAME, REGION,

    SUM(a.Pass / (COUNT(ACCGRPNUM))) AS RATE

    -- LOCATIONS THAT MEET CRITERIA--

    FROM...

  • RE: How do I search a string for a single space and not return double spaces e.g. find 'A B' not 'A B'

    oliver.morris (11/25/2011)


    Hopefully a simple question for friday morning, but I have no clue in SQL how to do this,

    Many Thanks for the help,

    Oliver

    Something like this?

    DECLARE @TABLE AS TABLE (string VARCHAR(50))

    INSERT...

  • RE: How to get records in groups

    SameerKKhan (11/25/2011)


    Cant i use the Date filter with (yyyy/MM/dd) format only.Just to check the year,Month,Day and bring the time part in the picture.

    cant i use the- convert(varchar(10),getDate,111) to...

  • RE: For xml path format question

    BEGIN TRAN

    CREATE TABLE companies (id INT)

    INSERT INTO companies

    SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3

    SELECT CAST('<img href="http://google.com/' + CAST(id AS VARCHAR(50)) + '_thumb.jpg" />' AS XML) AS

    FROM...

  • RE: How to get records in groups

    SameerKKhan (11/25/2011)


    hi thank u so much for the reply,

    i want to add another filter to the Query i.e the Date.There is a Date column in Attendance.

    I want to get...

  • RE: Date comparsion error

    You're using "your" proc incorrectly.

    DECLARE @MyPeriod INT

    SET @MyPeriod = CONVERT(INT, '201103')

    SET @MyPeriod = CASE WHEN @MyPeriod BETWEEN 175301 AND 999912 AND @MyPeriod % 100 BETWEEN 1 AND 12

    ...

  • RE: Char to DateTime Seconds Rounding

    rootfixxxer (11/24/2011)


    Hello

    I was testing here some data with dates, but then i realize that sql server rounds the seconds, when converting from a string to a datetime/smalldatetime.

    What's the "problem"/logic behind...

Viewing 15 posts - 1,276 through 1,290 (of 2,007 total)