Forum Replies Created

Viewing 15 posts - 91 through 105 (of 132 total)

  • RE: DATEDIFF on different rows

    Dave

    This is ugly but it looks like it gives you what you want.:

    select a.empid, a.start_date_time, a.end_date_time

    from

     table_a a

    inner join (

    select orig.*, datediff(dd, orig.end_date_time, x.min_start_date) as day_diff, dateadd(dd, datediff(dd, orig.end_date_time, x.min_start_date), orig.end_date_time...

  • RE: DATEDIFF on different rows

    quick question, you said the following:

    The first row END DATE TIME = 01/04/2006

    The second row START DATE TIME = 01/07/2006

    you would not want these records since it is greater than three...

  • RE: DATEDIFF on different rows

    Dave

    If I have time, I would be happy to try to write up some SQL for you but I am not totally clear on what your resultset should look like.

  • RE: Database Transfer Task Error

    Jacqueline

    Just a follow up, my client did apply the SP2a to their SQL Servers and this task worked successfully, provided I had the database users already created on the destination...

  • RE: DATEDIFF on different rows

    this should be a starting point to work with, i named the table table_a for your three fields:

    select

    orig.*, datediff(

  • RE: Database Transfer Task Error

    Jacqueline

    I am curious, did downloading SP2 help you with this SSIS task? I am currently working with a client and we are running into issues stating that the user currently...

  • RE: changing a table''''s owner

    sure, use the sp_changeobjectowner sp:

    EXEC sp_changeobjectowner 'table_name', 'dbo'

  • RE: Query to pick columns from multiple tables

    this may be a little hard coded but you are talking months here, which will not be changing anytime soon. however, you may want to look into a time table...

  • RE: Need help with Having and Max function

    i am guessing that the avgcost field is already calculated. with that being said, this should help at least get you down a path:

    select orig.itemid, orig.year, orig.avgcost

    from

    (select itemid, year, avgcost

    from...

  • RE: Moving Views in 2005

    In SSIS there is a Transfer SQL Server Objects task that will allow you to copy over database objects. In there, you see the option for Copy All Views or...

  • RE: Need help with Having and Max function

    without knowing your data, this query may get you what you want:

    SELECT ItemId, year, AvgCost

     FROM         dbo.tblItemAvgCost

     WHERE     (AvgCost <> 0)

     and year = (select max(year) from dbo.tblItemAvgCost where avgcost<>0)

  • RE: Help in script....variable returns 0....

    sure, reset your sql string to each of the new queries that you want to execute and then update your temp table with the execution for each piece OR create...

  • RE: Help in script....variable returns 0....

    what sql is reading is the literal value of @column_name and checking to see if that is null or '' and i take it that is not what you want....

  • RE: Help in script....variable returns 0....

    your issue in the script is that the blank quantity var will only either be 1 or 0 and that is based upon the @column_name being null or <> '', which...

  • RE: Calling procedure / trigger

    good information to know. thanks robert

Viewing 15 posts - 91 through 105 (of 132 total)