Forum Replies Created

Viewing 15 posts - 2,356 through 2,370 (of 10,143 total)

  • RE: How to partition and add sequence/rownumber using CTE or Row_number()

    sqlbidev (7/6/2015)


    Hi there,

    I have the following table struction, lets call it table A.

    bookidstartdate endate

    2001 2000-01-01 2000-01-05

    3001 ...

  • RE: How to partition and add sequence/rownumber using CTE or Row_number()

    sqlbidev (7/6/2015)


    Hi there,

    I have the following table struction, lets call it table A.

    bookidstartdate endate

    2001 2000-01-01 2000-01-05

    3001 ...

  • RE: Operand type clash: int is incompatible with date

    mandania (7/3/2015)


    they are both date type

    Here's your error:

    case

    when Rownum<= datediff(day, salesdate, baseenddate) then DATEADD(mm, RowNum, salesdate)

    else 0 end

    You have two different datatypes returned by your CASE....

  • RE: Operand type clash: int is incompatible with date

    mandania (7/3/2015)


    Hello, i have been trying to solve this for sometime but i cant get around it. hopefully somebody can help me out here.

    this is a piece of my code:

    ...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (7/3/2015)


    GilaMonster (7/3/2015)


    TomThomson (7/3/2015)


    But don't make the mistake of thinking that all-nighters are always a sign of problems, or long hours (how can long hours be "heroic"?).

    No, I'm...

  • RE: Are the posted questions getting worse?

    Sean Lange (7/2/2015)


    jasona.work (7/2/2015)


    Today is the kind of day (and it's only been an hour and a half since I got to work) that you clock watch...

    OTOH, got plenty to...

  • RE: Are the posted questions getting worse?

    Ed Wagner (7/2/2015)


    jasona.work (7/2/2015)


    Today is the kind of day (and it's only been an hour and a half since I got to work) that you clock watch...

    OTOH, got plenty to...

  • RE: OVER clause with Aggregate function - Wierd

    Run this tweak to observe a less irregular usage 😉

    ;WITH CTE AS

    (

    SELECT 1 AS ID, 10000 AS SALARY,GETDATE() AS DOJ

    UNION ALL

    SELECT 1, 13000,GETDATE() - 10

    UNION ALL

    SELECT 3, 190000,GETDATE() +...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (7/2/2015)


    ChrisM@Work (7/2/2015)


    Koen Verbeeck (7/2/2015)


    BL0B_EATER (7/2/2015)


    Yesterday it was about 35C, and I was working from home with no A/C.

    Sounds good to me... were you in the garden sipping on...

  • RE: Self Join alternative

    Sam Garth (7/2/2015)


    Thank you all for the suggestion, however If I was to run the following

    INSERT INTO #Data

    VALUES

    (4,'Got Dressed','2015-07-02 06:00:00.000')

    And then run my query, It would show me two entries...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (7/2/2015)


    BL0B_EATER (7/2/2015)


    Yesterday it was about 35C, and I was working from home with no A/C.

    Sounds good to me... were you in the garden sipping on a cool beverage...

  • RE: Are the posted questions getting worse?

    Eirikur Eiriksson (7/2/2015)


    BL0B_EATER (7/2/2015)


    Yesterday was ridiculous in the UK - 34C.. and in an office with no A/C.

    Didn't measure the temperature in the Central Line tube yesterday but I've been...

  • RE: Are the posted questions getting worse?

    BL0B_EATER (7/2/2015)


    ChrisM@Work (7/2/2015)


    BL0B_EATER (7/2/2015)


    Yesterday was ridiculous in the UK - 34C.. and in an office with no A/C.

    That's not so good. Neither were the delays on the train network -...

  • RE: Are the posted questions getting worse?

    BL0B_EATER (7/2/2015)


    Yesterday was ridiculous in the UK - 34C.. and in an office with no A/C.

    That's not so good. Neither were the delays on the train network - it took...

  • RE: Self Join alternative

    Sam Garth (7/1/2015)


    Hi

    I am trying to increase performance of a query that joins a table 19 times.

    The current example works similarly to below...

    CREATE TABLE #Data(PersonID INT, Activity nvarchar(200), ActivityTime DATETIME)

    INSERT...

Viewing 15 posts - 2,356 through 2,370 (of 10,143 total)