Forum Replies Created

Viewing 15 posts - 361 through 375 (of 429 total)

  • RE: report to check the result for 10 consucutive minutes

    If the process can be changed add another column(ShowInReport BIT) and during the inserts update that column whether to display or not.

    Only other option I can think is go with a...

  • RE: Simple deuping

    SET NOCOUNT ON

    DECLARE @theatre TABLE

    (

    [ID] INT IDENTITY,

    LastName VARCHAR(25),

    FirstName VARCHAR(25)

    )

    INSERT INTO @theatre (LastName, FirstName) VALUES ('L1111', 'F1111')

    INSERT INTO @theatre (LastName, FirstName) VALUES ('L2222', 'F2222')

    INSERT INTO @theatre (LastName, FirstName) VALUES ('L3333', 'F3333')

    INSERT INTO @theatre...

  • RE: Max of date from multiple columns

    Yes I would love to do that.

    I made the query little better.

    select TOP 1 myVersion, max(mydate)

    from (

     select myVersion, max(lastdatea) 'mydate'

     from @MyTable group...

  • RE: report to check the result for 10 consucutive minutes

    Remi has given the answer for random sampling it is close to the requirement.

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=187471#bm187503

  • RE: Max of date from multiple columns

    Thanks Mike.

    We have a table with versions and updates from various sources. Each source will update the version and their date. Example if Source A updates the version it will...

  • RE: Max of date from multiple columns

    I modified Steeve's query and got the result. Is there any better way to do it

    Added - I am not sure this gives the correct value all the times

    select myVersion,...

  • RE: Max of date from multiple columns

    I need the myVersion in the table which is for the lates of all 9 dates.

    like this case lates date is 04/09/2004

    So I need VERSION C as result

  • RE: Max of date from multiple columns

    Thanks Steve. That is simple.

    But how do I get my Version for that date.

  • RE: How to call a function with default parameter values

    Thanks Remi. Why did't I try that.

    I have 5 parameters in my original function and have to pass 5 defaults. I like the the way how it works with Stored...

  • RE: How to call a function with default parameter values

    Thanks Mike If that is the case with my example in post

    SELECT * FROM Fn_myDate(NULL) 

    SELECT * FROM Fn_myDate('01/01/1982')

    Both calls should give same results. But it is not. Can you...

  • RE: How to call a function with default parameter values

    /* This how I call a stored procedure with default parameter any help with function is greatly appreciated */

    CREATE PROCEDURE TEST

    (@pmyDate DATETIME = NULL)

    AS

    SELECT ISNULL(@pmyDate, GETDATE()) myDate

    GO

    EXEC...

  • RE: SUM of Latest 4 dates

    Thanks Paul. I am taking your first part.

    I don't go for dynamic #of cols since the report generated has many other columns and some other complex logic. The specifications are...

  • RE: DATETIME TO VARCHAR

    SET NOCOUNT ON

    DECLARE @CTR INT

    SET @CTR = 100

    WHILE @CTR < 115

    BEGIN

    SELECT @CTR Val, CONVERT(VARCHAR, GETDATE(), @CTR) DteFormat

    SET @CTR = @CTR + 1

    END

  • RE: SUM of Latest 4 dates

    Cool. I will use it. Thank You.

    Atleaset that is not my case Remi. I am happy with Ron's query.

    We can continue for dynamic # of weeks for interest.

  • RE: SUM of Latest 4 dates

    Nope. Not at all. I want resultset like this.

    Version                        Week3   Week2     Week1   Currnt     

    -----------------------    --------   --------   ---------   ------

    AA                               42         212        2          231

    AC                               0           0           0          32

    AG                               0           0           52         372

    AV                               0           0           0           564

    AF                               2           0           72          0

    AR                              ...

Viewing 15 posts - 361 through 375 (of 429 total)