Forum Replies Created

Viewing 15 posts - 16 through 30 (of 51 total)

  • RE: SQL Query Again - Complex

    RAJ

    Please, in Query Analyzer, press CTRL-T and next run a SELECT * FROM BETS

    Post the results...

    Thank you!

    BTW... I'm sorry I forgot the ENDs... my wife was waiting for dinner!

    Nicolas...

  • RE: SQL Query Again - Complex

    Hi,

    I'm not sure if tis could work, 'cause I'm at home and have no SQL Server to try it, but I hope you could catch the idea at least...

    Supposing...

  • RE: performance of a query

    AJ... you said "Instead of using this variable set an internal (after the AS) variable.  There is a potential performance problem (not well known/documented) that could also be affecting...

  • RE: Reshaping vertical data to horizontal layout.

    Hi...

    there's another soution, using dynamic sql... there is the code...

    note that I'm ading an extra row to have an instance of a missing value for "ind", otherwise there would...

  • RE: Datetime field and SQL statement condition (between, ....)

    It's not a good idea letting SQL to implicit convert strings to datetime... i always prefer to force an explicit conversion, so you don't need to take care on how...

  • RE: Query Syntax Error

    Still.... again me!!!

    Look at thi query... I think it's something like this what you want, no?

     

    set nocount on

    create table #tmp__1 (piDate smalldatetime, Val1...

  • RE: Query Syntax Error

    well.. again me!

    If I understood your needs... you want to obtain the TOAL AMOUNT (SUM) of TopAmt1 And some partial sums depending on some other...

  • RE: Query Syntax Error

    Again... please, post tha tables structures and examples of original and desired data... and any meaningful constraint and/or relation .

    Nicolas

  • RE: Query Syntax Error

    Sure...

    cast((select CASE WHEN [SvLOB]='HP' And [SvSrcX]='M' THEN topamt1 ELSE 0 END) as money)

    is invalid just like the Q/A said... you can't put any column which is not contained...

  • RE: SELECT Statement Question

    Also...

    submit a real example... this one would always return a single value ( your "x" )

    and it's the same as

    SELECT ID FROM TableA WHERE ID = x

    no need to use...

  • RE: SELECT Statement Question

    Is this what you need?

    SELECT  A.ID

    FROM    TableA A

    WHERE  ID IN (  SELECT     ID

                          FROM          TableA B

                          WHERE      B.ID = A.ID ))

    GROUP BY A.ID

    If not, would you submit an...

  • RE: Or statements in a Select join

    I don't know if it's what you're meaning, but you can define which index the query would use, on the from/join statements...

    SELECT a,b,c FROM TableOne T1 ( INDEX(MyFirstIndex) )

    INNER JOIN TableTwo...

  • RE: Select where one date must include others

    Jean-Luc: Would you submit the join code you're trying?

     

    Nicolas

     

  • RE: Case Statement

    People... that's not what Dashii needs... I think the mentioned Sp code must something like:

    IF LogicalOne BEGIN

              Statement 1

              Statement 2

              etc.

    END

    ELSE IF LogicalTwo BEGIN

                      Statement 1

                      Statement 2

           ...

  • RE: Paramater with a Conditional

    Isaiah,  it seems like you wanted to do this...

    Declare @ACTION char (3)

    Declare @IsNewHire bit

    Set @ACTION = 'HIR'

    Set @IsNewHire =

      CASE WHEN @ACTION <> 'HIR'...

Viewing 15 posts - 16 through 30 (of 51 total)