Forum Replies Created

Viewing 15 posts - 166 through 180 (of 284 total)

  • RE: Adding workdays

    Ok, fine. If you don't want to take the trouble to tweak it, I guess I will. It is my code, I suppose, so who better?

    Here is a slight tweak...

  • RE: Adding workdays

    On my server it means Monday, not Sunday.

    That's fine, use the values that match your server or DateName() instead. Remember, these routines were developed to meet in-house needs. They were...

  • RE: Adding workdays

    Sergiy, wouldn't it be possible to have a small table of only hollidays, and if @DateEnd falls on one of those days just add 1?

    Here are a couple of...

  • RE: Converting Float value to varchar

    DECLARE @fl AS FLOAT

    Just change float to decimal (or numeric). Internally, floats and doubles are maintained in an entirely different format from decimals and numerics. That's why you don't get...

  • RE: complex select problem w history tables, date ranges

    I tried using "& nbsp;", as well as html tags such as <pre> (what I had been using). They are ignored.

    Wait. Notice the space before the "nbsp;" above. The ampersand...

  • RE: complex select problem w history tables, date ranges

    SELECT U1.UserNew

    &nbsp&nbsp&nbsp&nbsp,D.TelNumber

    &nbsp&nbsp&nbsp&nbsp,D.ChangeDate AS DeviceDate

    &nbsp&nbsp&nbsp&nbsp,D.IMEInew

    Ken,

    How do you format the code in your post? I can't get this new forum tool to work for me.

  • RE: Complex Count/Sum

    It sounds like you have actual column "Fast", "Slow", etc. in different tables and you want a total count and summation from all those tables. Here, with just a few...

  • RE: Optimizing SQL System Stored Procedures - What's in a SELECT?

    I doubt Microsoft will deprecate select * because, like it or not, it is part of the SQL standard. I agree with dots67's comparison between select * and goto. It...

  • RE: Standardizing Primary keys

    I wouldn't make an alpha-numeric primary key... they're slow and difficult to maintain.

    Why don't you just use an INDENTITY column and a Country column?

    Alpha or alpha-numeric keys are not significantly...

  • RE: Data between 2 timestamps

    If you have a Number or Tally table, you can generate a list of time values very easily. My Tally table column is Num and the values start at 0....

  • RE: DATE TIME Issue

    select 1 where getdate() <= convert(datetime,convert(varchar(10),'01/01/2008',103),103)

    Why do all the converting: char(10) to varchar(10) to datetime? And why lock yourself into a specific format? Let the system perform an implicit conversion...

  • RE: Remove Decimals Without Rounding

    Oh, sorry. :blush: I forgot to mention that it would seem to work because @Result is left at the correct answer from the method that came before it. So when...

  • RE: Remove Decimals Without Rounding

    Sorry, Jeff. You got the third method to operate a little faster by removing the setup just before entering the loop. This is a crucial step. Without it, the method...

  • RE: Remove Decimals Without Rounding

    Here's what I used:

    -- Initialization common to both methods.

    Declare @original decimal( 38, 12 ),

    @Result decimal( 38, 0 ); ...

  • RE: Is this workable

    ... and what about the EndDates that are NULL? 😉

    I answered that already. I defined my test table with a nullable datetime field. However, the OP seemed to be...

Viewing 15 posts - 166 through 180 (of 284 total)