Forum Replies Created

Viewing 15 posts - 556 through 570 (of 620 total)

  • RE: Adding workdays

    Michael Meierruth (10/23/2007)


    And when a Saturday or Sunday is supplied for the end date then it should be considered the equivalent of the previous Friday. Both the Workdays and AddWorkdays...

  • RE: Adding workdays

    Sergiy (10/22/2007)


    Of course I messed with whole number divisions and remainders.

    Here is correct version (I believe ;))

    [Code]

    SELECT CreateDate + @NotificationDays/5*7 + @NotificationDays%5 +

    ...

  • RE: Can You Give Me Tips To Creating Test Data

    If you want an exact replica of your real data, just do this

    SELECT *

    INTO YourTable_Test (Or whatevery you want to call it)

    FROM YourTable

    I am fairly certain the new table will...

  • RE: Adding workdays

    Sergiy (10/22/2007)


    Greg Snidow (10/21/2007)


    Kenneth, I am using it for setting the delivery date for email notification in an email staging table. ...

  • RE: Adding workdays

    Kenneth Wilhelmsson (10/22/2007)


    Greg,

    ok, and how are these mails staged?

    one-by-one? By the thousands? (or millions?)

    Are you looking for the 'batch-approach' that Jeff speaks of, or is it less?

    Just trying to set...

  • RE: Adding workdays

    Kenneth Wilhelmsson (10/19/2007)


    Another thing that also may have some impact on how to implement it, is what is it for?

    That is, how is it going to be used?

    Inline with...

  • RE: Adding workdays

    Jeff Moden (10/18/2007)


    In the mean time... It took me a couple of hours to figure it out, but I took quite a different approach... and, the function I built gives...

  • RE: Adding workdays

    Sergiy (10/19/2007)


    OK, short version:

    If you need "Holiday table" anyway, if you need to scan for the holidays in that table - why scan table AND run UDF?

    Why not just include...

  • RE: Adding workdays

    Matt Miller (10/18/2007)


    APOLOGIES.....

    There was STILL one flaw...was trying to fix some of the f****ing formatting, and I blew out a 5 and replaced it with a 7. Had been...

  • RE: Adding workdays

    Sergiy (10/19/2007)


    Funny story guys is that your UDF's don't work.

    No matter how hard you try to perfect it.

    They don't work by definition.

    And nobody can do anything about it.

    At least they...

  • RE: Adding workdays

    Matt, I think that did it! I can't test on my real data until I get to work, but on my test table at home it seems to work...

  • RE: Adding workdays

    Matt Miller (10/18/2007)


    I keep trying with not quite enough data to see the flaw

    I Kept doing the same thing. I tested one date against Jeff's code, trying to reverse...

  • RE: Adding workdays

    Matt, I can not tell you how much I appreciate you taking time out of your day to work on this. It seems you are running in to...

  • RE: Adding workdays

    That makes sense. I think there is a problem with it though. If I enter '1/2/2008' as @Datestart which is a Wednesday, and 4 as @DaysToAdd, @DateEnd is...

  • RE: Adding workdays

    Matt Miller (10/18/2007)


    Select @datestart=dateadd(dd,case when cast(cast(@datestart as datetime) as int)%7 >4 then

    Matt, this works great! I am curious though, why do you have:

    ..CAST(CAST(@Datestart AS DATETIME)AS INT)...?

    I tried...

Viewing 15 posts - 556 through 570 (of 620 total)