Forum Replies Created

Viewing 15 posts - 56,866 through 56,880 (of 59,072 total)

  • RE: how to format string/number (1 to 0001)

    Thought I'd add one... see "M3"...

    select

      M1 = right(1000000+MyNumber,4) ,

      M2 = right('0000'+convert(varchar(20),MyNumber),4),

      M3 = REPLACE(STR(MyNumber,4),' ','0')

    from

      (

      select MyNumber=1 union all

      select 10 union all

      select 44 union all

      select 7777 union all

      select 9999 union...

  • RE: Workday calculations

    Yep... I missed that... thanks Michael...

    Jeremy, you need to change your function to a scalar function that returns a DATETIME instead of a table... then it should work ok...

  • RE: Ideas for SQLServerCentral.com

    Personnally, the look and feel of SSC are both the best on the web I've seen.  I'd leave it alone so far as any look and feel goes...

    But I would...

  • RE: Workday calculations

    Don't need the WorkCalendar join anymore... you have the function...

     SELECT o.Order_Num,

            o.CustomerNumber,

            o.ItemNum,

            o.RequireDate,

            o.State,

            tt.PrepTime,

            dbo.CalcDate(o.RequireDate,-tt.PrepTime) AS RequiredShipDate

       FROM dbo.Order...

  • RE: sp_helpDB only works from master

    I'd have to say "No".  The default for this setting is "OFF".  The only risk is if there's some really poor code written for GUI's that doesn't ID the type...

  • RE: Bulk insert data conversion error (truncation) for row 1001

    >>Bulk insert data conversion error (truncation) for row 10001

    That error has nothing to do with the batch size... it has everything to do with the column size of your target...

  • RE: UPDATE from two tables

    Oh no, no, no... not true... check Books Online... every single example where a join is involved has the target of the update in the FROM clause, as well.  In...

  • RE: Workday calculations

    Like I said... make a function using the SELECT examples I gave... then just do a joined select and use the function passing the date from one table...

  • RE: NULL Equals NULL?

    Mike C,

    Man, nice job.  I absolutely agree with Tim's assesment of the "AA" he speaks of.  The real fact is "NULLs Happen" ...

  • RE: NULL Equals NULL?

    Speaking of "no clue"...

    select(field1) + sum(field2) from #table1

    ... will yield ...

    Server: Msg 8118, Level 16, State 1, Line 1

    Column '#table1.field1' is invalid in the select...

  • RE: The Best Thing?

    I just love the fact that there's an average of more than 16 bytes of structure for every byte of actual data   It's...

  • RE: Workday calculations

    Lot's of folks will do a calculation like this...

    --===== A way without the WorkDayCountColumn

    SELECT c.Date

        FROM #Calendar c

        WHERE

            c.IsWorkDay = 1

        AND 4+1...

  • RE: Workday calculations

    I see you're online right now, Jeremy... gimme a couple minutes more and I'll show you one way to do this...

     

  • RE: Row number

    quoteI want to avoid temp tables..trying to get in a simple select if possible from system functions.

    Can you...

  • RE: Alter Table

    So, basically, it's a data model change with a cleanup script to boot and not a permanent stored procedure?

    If that's true, then just add a GO on a separate line...

Viewing 15 posts - 56,866 through 56,880 (of 59,072 total)