Forum Replies Created

Viewing 15 posts - 31 through 45 (of 69 total)

  • RE: SQL Where Clause

    SQLBill,

    Unless you want a specific resample done, is it necessary to run sp_Updatestats if the database option of Auto Update statistics is...

  • RE: Concatenating in select statement?

    SELECT [Name], dbo.udf_test([Name])

    FROM (SELECT [Name] FROM [Table1] GROUP BY [Name]) a

    ORDER BY [Name] ASC

     

    David,

    Why did you do an Alias here?  You didn't have a reference...

  • RE: Current date, previous date and the delta

    You may need a group by clause

     

    Select T1.Date as [Current], MAX(T2.Date) as [Previous], DATEDIFF(dd, MAX(T2.Date), T1.Date ) as [Delta]

    FROM Table T1

    LEFT JOIN Table T2 on T2.Date < T1.Date

    group by...

  • RE: UPDATE OPENQUERY multiple table selection possible ?

    Since you didn't post the syntax you used, how would we know! 

    Check out the join syntax with BOL.  Typically, a simple join syntax...

  • RE: TO UPDATE THE VALUES IN ONE SHOT

    May be try something like this.

     

    In as stored procedure, set pass in @ItemIDs = '101,103,105'

    declare @Itemids varchar(1000)

    declare @SQL varchar(8000)

    set @SQL = 'Update tablename  Set State = 10...

  • RE: UPDATE OPENQUERY multiple table selection possible ?

    I would use a join probably.

    ... from PURC_ORDER_LINE POL Inner Join OtherTable OT ON  OT.SomeField = POL.SomeField.

    Then use the values from OT to populate the POL update.

  • RE: full text search question

    Nope sorry.  In our databases the ShipNo is a seperate and indexed field.  Makes it pretty quick to locate what one needs.

  • RE: full text search question

    Couldn't it be a simple Like statement??

     

    select ommemo from tblordermemo where OmMemo like '%W034%'

  • RE: Times by quarterhour

    Thanks PW.  I new there was a way and I just kept fiddling with views etc with no success.  I do appreciate your answer!!   I have read over and over...

  • RE: SQL 2005 (64Bit)

    Thanks all.  Apparently MS has some problems with the 64bit version.  We reverted back to the 32 bit version and everything seems to be working fine..

     

     

  • RE: Problem using Join to Query tables

    Perhaps you should consider the table first that has all of the records, Orders.  Then do Left Outer joins to it with the reasoning being that if we have an...

  • RE: Seconds to dd:hh:mm:ss

    Pretty nifty Jeff.  Thanks for the coaching.  I use functions a lot because I hate to remember and then type all the syntax!!

  • RE: Seconds to dd:hh:mm:ss

    Thank you David.  Trying to stay away from cursors.  Old habits die hard!!

  • RE: Seconds to dd:hh:mm:ss

    You might try using a function like this:

     

    CREATE FUNCTION fn_GetDays(@InSecs As int)

    RETURNS varchar(36) AS 

    BEGIN

      declare

      @GetDays varChar(200)

    -- Get the Days, Hours, Minutes, Seconds returned with input in Seconds

    -- Use:   Select...

  • RE: help me out here please!

    Suggestion:  Put IdentityKey in detail table (D). Put LastCallID field in Master (M).   Have Detail OnInsert Trigger update M.LastCallID  with D.IdentityKey.  If you are always looking for the last call from all...

Viewing 15 posts - 31 through 45 (of 69 total)