Forum Replies Created

Viewing 15 posts - 121 through 135 (of 345 total)

  • RE: help with datediff for hours

    I separated the recordset into power on times and power off times. Then join those on the ID where the power off times come after the power on times. Then...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: help with datediff for hours

    memostone86 (10/11/2011)


    SQLRNNR (10/11/2011)


    toddasd (10/11/2011)


    How do you figure HoursOn for 2323 is 7?

    I come up with ~5h55m on that one.

    The lastest status for 2323 on 6/30/2011, the status is on after...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: help with datediff for hours

    How do you figure HoursOn for 2323 is 7?

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Is Dynamic SQL okay when it uses no user fields in its input?

    pdonley (10/11/2011)


    toddasd, I believe you are correct. I must have been using the wrong term. I apologize. What you said is exactly what I am doing.

    Not a problem. It struck...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Is Dynamic SQL okay when it uses no user fields in its input?

    It sounds like you are building the query in the front-end code and then sending that query to the database to be executed. If that is the case, then that...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: agregate join

    chauchs (10/11/2011)


    select t1.f1, t2.f1

    from table1 t1

    join table1 t2

    on t2.f5 = t1.f5

    and t2.f3 = t1.f3

    join table1 t3

    on t3.f5 = t1.f5

    and t3.f3 = (select...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: How to properly maintain updated dev/test database environments?

    Keopx (10/10/2011)


    Another thing I have thought of... are there scenarios where the real data from production servers is put available for developers/testers to work with? or do they use a...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: How to dynamically execute SQL stored as text in a table

    How does this work for you?

    alter procedure GetReport

    @SpoolID int

    AS

    declare @sql nvarchar(4000)

    select @sql=extrasql from reportspool where spoolid=@SpoolID

    exec (@sql)

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Update field based on another table field value

    Assuming you're doing this on a test server, start with this:

    CROP TABLE table1

    CROP TABLE table2

    (But change the Cs above for Ds. We seem to have some filter here that...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Update field based on another table field value

    Also, to answer the question you posted the DDL for, your update is safe ...in this sample set. If you get the query John provided and run that, you'll see...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Update field based on another table field value

    You can simplify your CASE expression like this:

    CASE table2.Code2

    WHEN '1-10' THEN 1

    WHEN '11-20' THEN 2

    WHEN '21-30' THEN 3

    WHEN '31-40' THEN 4

    WHEN '41-50' THEN 5

    WHEN '51-60' THEN 6

    WHEN '61-70'...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Update field based on another table field value

    branovuk (10/5/2011)


    I must ask one more question:

    How to use CASE statement (or similar, maybe if?),

    because it is not just Update, it is based on data from table2 another values in...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Job Opening in Kansas City/Topeka, KS

    But...it's Kansas 😛

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: SET @SQL = ...

    This will give you everything you want to know: http://www.sommarskog.se/dynamic_sql.html

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Trigger block problem

    Is there a question here, or is this just a demo of the most convoluted way possible to do table auditing?

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

Viewing 15 posts - 121 through 135 (of 345 total)