Forum Replies Created

Viewing 15 posts - 2,596 through 2,610 (of 4,080 total)

  • RE: Character's position frm a string

    declare @input varchar(100)

    set @input = '000100010001'

    ;with tally (N) as (select row_number() over (order by id) from master..syscolumns)

    select N from tally

    where substring(@input,N,1) = '1'

    and N <= len(@input)

    edited to...

    __________________________________________________

    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: Many to Many - selecting records that don't include a word

    Hey J-F,

    Your subquery solution is cleaner in that it avoids the uneccessary join to the item table to find the unwanted ItemIDs. The CTE solution should be...

    __________________________________________________

    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: Many to Many - selecting records that don't include a word

    Thanks for posting the sample data!!! It made my job MUCH simpler. 🙂

    The following solution uses explicit JOINS because your use of the WHERE clause with a...

    __________________________________________________

    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: New Datetime datatypes???

    Use CONVERT, because CAST doesn't give you all the formatting options.

    The new datatypes aren't necessary unless you want to disregard time or store really ancient dates. But you...

    __________________________________________________

    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: New Datetime datatypes???

    The internal storage of date and datetime information is actually an integer datatype, not a character string. However, it is presented as character string when you do a...

    __________________________________________________

    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 skipping entering 1st row on Insert

    Still don't see why what you have isn't working. But I do see that you are using a while loop in your parse function. ...

    __________________________________________________

    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 skipping entering 1st row on Insert

    While waiting on the parsestring function to be posted, I will also ask if you have considered rewriting it as a parse to produce a derived table to feed the...

    __________________________________________________

    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?

    Awwww... that's not true... I've got a couple thousand... errr dozen at most.

    __________________________________________________

    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: Aging Query

    Hey Michelle 🙂

    If you didn't already know, Lynn is renowned for his patience to the point that he has often been called Saint Lynn by the regulars at SSC....

    __________________________________________________

    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?

    Glad you like it, Lynn.

    Steve: Suggestion for new functionality... name/avatar history. 😀

    __________________________________________________

    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?

    Humor is subjective. In some people's cases, it needs to be subjected to a baseball bat.

    Hey! I resemble that remark!

    __________________________________________________

    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: Comparing 2 Months

    With the column changes in place, this works.

    declare @sample table (eligMonth dateTime, membID int)

    insert into @sample

    select '2009-07-01', 899931100 union all

    select '2009-07-01', 899931700 union all

    select '2009-07-01', 899931000...

    __________________________________________________

    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: Comparing 2 Months

    You are right of course that it would be nice to have some sample data from the author of the question. For example, we don't know if a...

    __________________________________________________

    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: Comparing 2 Months

    If a member can appear multiple times with multiple eligibility dates, and you are ONLY concerned about the current month and the previous month, then

    declare @sample table (member int,...

    __________________________________________________

    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: Comparing 2 Months

    Why can't you just test their membership date against the first day of this month?

    declare @sample table (member int, memberDate datetime)

    insert into @sample

    select 1, '7/9/2009' union all

    select 2, '7/19/2009'...

    __________________________________________________

    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,596 through 2,610 (of 4,080 total)