Forum Replies Created

Viewing 15 posts - 2,221 through 2,235 (of 4,080 total)

  • RE: Are the posted questions getting worse?

    That's how I interpreted it, Gail. This was my quick-and-dirty solution.

    declare @sample table (channel varchar(5), line_of_bus varchar(5), prod_nm varchar(20))

    insert into @sample

    select 'all', 'C1','last year p&c' union all

    select 'all',...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: t-sql question

    Couple of observations:

    1. You don't have daily data, yet you say you want to calculate MTD (month-to-date). Did you mean to say YTD (year-to-date)?

    2. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: query to modify

    Or he got run over by a bus... :crying:

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stored Procs and Unused Parameters

    Here's an example of a query to list parameters from the procedure "testProc".

    create procedure dbo.testProc

    @parm1 int = null

    ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Delete Duplicates

    You're welcome, PSB. Could you please take another minute to explain to us why this was "urgent"? That is a word that is being used...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Both are marked urgent, both don't give the proper table definitions or sample data, one gets the answer within 5mins and the other is made fun of. Any particular reason?

    I...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Delete Duplicates

    An opening parenthesis is missing. It should read: OVER (PARTITION BY etc

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Delete Duplicates

    I was going to ask if you had a preference about which account name to keep. The one with spaces, or the one without?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Another mutliple row update question!

    Just a note for the future, consider moving away from using TEXT fields to Varchar(Max) or Nvarchar(Max).

    As for the single statemement, consider something like this. (coded freehand and...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    BUT I would suggest that there are probably a lot of people out there like me who trying to do their best in a difficult but rewarding job, working long...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Chris, I am not bothered at all by basic questions from beginners. The irritation comes from people who post next to no background information and expect us to fill...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Trigger Raised Before Deleted For Each Row

    To trap an event before it happens you have to use INSTEAD OF in your trigger. The syntax is readily available in the help on line for...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Need to get one row per customer for multiple columns of data

    You can also read up on PIVOT/UNPIVOT. 🙂

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Trying to get this to work in one select statement

    Do you mean something like this?

    SELECT

    sum(case when invoiceDate = CAST(CONVERT(CHAR(8),GETDATE(),112) AS DECIMAL(8,0)) then 1 else 0 end) as d1

    ,sum(case when invoiceDate = CAST(CONVERT(CHAR(8),GETDATE()-1,112) AS DECIMAL(8,0)) then 1 else...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stored Procs and Unused Parameters

    Ahhhhh.... you beat me to it Michael! I just remembered doing a function for one of our developers to list the parms in a stored proc.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 2,221 through 2,235 (of 4,080 total)