Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)

  • RE: Table with month and year not sorted

    Actually it's OK. The records go into the table in the proper order so when I do a simple select without an "order by" clause, they come back in the...

  • RE: Detect change of month and year in datestamp

    Sean Lange (11/27/2012)


    leesider (11/27/2012)


    OK, as I said in my last post I need to extend it a little further to include a running total. Cadavre is correct, I don't need...

  • RE: Detect change of month and year in datestamp

    OK, as I said in my last post I need to extend it a little further to include a running total. Cadavre is correct, I don't need a cursor. ...

  • RE: Detect change of month and year in datestamp

    Sean Lange (11/26/2012)


    You should look at datepart.

    For example, 2012-04-03 is in the fifteenth week of the year so if that date appears then the week number 15 should appear...

  • RE: Detect change of month and year in datestamp

    Cadavre (11/26/2012)


    leesider (11/26/2012)


    I am going to need a cursor, I just don't know how to detect when a year or month datepart changes from date to date.

    No cursor required.

    Try this:...

  • RE: Concurrency question

    That's what I thought thanks 🙂

  • RE: Cannot edit stored procedures

    Silly me, I am able to work around it by right-clicking and selecting "Script Stored procedure as" and then "Alter to".

    Don't know why modify is doing that but the above...

  • RE: Sum two tables

    anthony.green (6/6/2012)


    You need a full outer join.

    declare @tab1 table (year int, week int, total_savings decimal(36,18))

    declare @tab2 table (year int, week int, total_savings decimal(36,18))

    insert into @tab1 (year, week, total_savings) values

    (2012,...

  • RE: Sum two tables

    okbangas (6/6/2012)


    select t1.total_savings+t2.total_savings as total_savings

    from

    t1 inner join

    t2 on t1.year = t2.year and t1.week = t2.week

    My apologies, I didn't make myself clear. The above query...

Viewing 9 posts - 1 through 9 (of 9 total)