Forum Replies Created

Viewing 15 posts - 1,111 through 1,125 (of 1,923 total)

  • RE: SQL function returning NULL value though the data is present.

    How about this?

    Function code:

    IF OBJECT_ID (N'dbo.GetEloquaColumn', N'IF') IS NOT NULL

    DROP FUNCTION dbo.GetEloquaColumn;

    GO

    CREATE FUNCTION [dbo].[GetEloquaColumn]

    (

    @Code_String NVARCHAR(200)

    )

    RETURNS TABLE

    AS

    RETURN

    (

    SELECT STUFF (Eloqua_Field_reference,1,1,'') Eloqua_Field_reference

    FROM

    (...

  • RE: SQL function returning NULL value though the data is present.

    Sathish, without seeing your data, we can't debug the Function.. so can u cook up some sample data out of your original data and post it in the form of...

  • RE: replacing Group By with row_number()

    Even i have seen that behaviour.. GROUP BY beats ROW_NUMBER by comfortable margin when it is run over large dataset.. if you could provide samples of your environment, it would...

  • RE: pivot query

    Try this:

    Tweaked with the idea from Mark:

    ; with cte0 as

    (

    SELECT name,cost , saledate

    ,Quarter_Num = DATEPART(Q ,[saledate] )

    ...

  • RE: pivot query

    OOooch :pinch:, Mark beat me to it..

    one variation between Mark and mine, i used DATENAME for the Month, he used DATEPART.. both do the same, infact, mark's is good one,...

  • RE: pivot query

    Hmmm.. try this:

    ; with cte as

    (

    SELECT name,cost , saledate ,

    Quarter_Num = DATEPART(M ,[saledate] )

    ,Month_Name ...

  • RE: pivot query

    Syed Khalid, tel me, honestly, it is an interview question or home-work question , isn't it?

  • RE: trim and round

    The Dixie Flatline (9/21/2010)


    You spin me round round, baby, right round....

    😀 Lol,Bob

  • RE: Need help on rounding number

    cutecrazyguy (9/21/2010)


    you put a 'd' word in the end of statement, what does it used for ?

    is that something like aliasses ?

    thx.

    Exactly, tat is the alias for the sub-query present...

  • RE: Problems with select

    Chris Morris-439714 (9/21/2010)


    Edit: Oops, ColdCoffee beat me to it.

    Ah , never CM.. i always enjoy reading through your innovative ideas of solving questions, makes me learn a lot.. i enjoy...

  • RE: Problems with select

    Try this: (This is what ashish was mentioning)

    Declare @UserSelection INT

    SET @UserSelection = 58

    select * from

    (

    select 1 ,0.00 ,20.00, 7.90

    union all select 2, 21.00, 60.00 ,10.70

    union all...

  • RE: select query with all values

    Craig Farrell (9/21/2010)


    I did explode mine out to make sure it covered an entire day rather then just the specific points in his exact result set. I made the...

  • RE: select query with all values

    Craig and Vekatraman, With all due respect to your wonderful attempts, both of your queries are not what the OP is expecting..

    Try this:

    DECLARE @Tab TABLE

    (

    Number BIGINT,

    Time_Stamp DATETIME

    )

    INSERT INTO @Tab

    ...

  • RE: String Parsing

    Glad we could help! 🙂

  • RE: Change dataset from multiple columns to multiple rows

    Thanks for the feedback, Lee

Viewing 15 posts - 1,111 through 1,125 (of 1,923 total)