Forum Replies Created

Viewing 15 posts - 871 through 885 (of 1,923 total)

  • RE: Join help!!!

    Yes, work out with REPLACE.. Like : REPLACE(column, ':','')

  • RE: How to summarise, listing on same line

    hey timo, sorry couldnt get time to work on ur request, but seems like u figured it out yourself... thanks for the posting the final code, helps a lot of...

  • RE: How to return hrs,mins and secs from a function when date time stamp is passed to that function..

    How can u find DIFFERENCE between 2 entities with just having one entity ? DATEDIFF requires 2 dates to find the diff... one date is the one u are currently...

  • RE: Select statement from 2 different data models

    Try this:

    ;with cte as

    (

    select *

    from #DataModel2 pivot_Table

    pivot

    ( max(analyticvalue) for AnalyticType in ([Analytic4],[Analytic5],[Analytic6])) pivot_handle

    )

    SELECT dm1.id, [Analytic1],[Analytic2],[Analytic3] ,[Analytic4],[Analytic5],[Analytic6]

    from #DataModel1 DM1

    inner join cte cte

    on cte.id = dm1.ID

  • RE: Query Help

    Try this:

    declare @UserDate DATETIME

    select main.EID ,

    MTD = ( select SUM(checkamount)

    from table t_mtd

    ...

  • RE: Help required please.

    Can you give us some MOCK-UP sample data to base our queries ?

  • RE: Help required please.

    Try this:

    DECLARE @Now DATETIME

    SET @Now = GETDATE()

    DROP Table #tmpDocSummary

    ; with cte as

    (

    select D1.ClientID , I1.*

    , rn = row_number over(partition by d1.clientid order by I1.DocSummaryKey...

  • RE: Help required please.

    Phil, why this?

    and convert(varchar(10),I1.DateExpiry,120) >= convert(varchar(10),GetDate(),120)

    Change that to:

    DECLARE @Now DATETIME

    SET @Now = GETDATE()

    AND l1.DateExpiry = @Now

    Secondly, can you explain your situation with some nice sample data and nice expected result?

  • RE: Overlapping records

    For each Badge and Site, will there be only 2 rows ?

  • RE: Delete Syntax Help

    Try the ISDATE function.. something like:

    delete from table where isdate(column) <> 1

  • RE: 10 rows to check the high value and do some calcs

    Best_boy26 (3/20/2011)


    I am not looking for the highest value, I am looking to get from above rows (current row - 10 above rows) the highest value listed in what row...

    My...

  • RE: 10 rows to check the high value and do some calcs

    Try this:

    with cte as

    (

    select rn = ROW_NUMBER() over( order by (select null)) ,

    i_c_o

    from IC_Raw_In

    )

    , tiled as

    (

    select NT = NTILE(10) over (order...

  • RE: Insert data into a table from another table

    "JOIN" is what u are after 🙂

  • RE: TSQL parsing out a URL

    LutzM (3/19/2011)


    Here's a slightly different approach:

    SELECT SUBSTRING(URLs,8,charindex('/',URLs+'/',8)-8) AS URLs

    FROM @URLTable

    Smart Lutz!! I dint notice that the first occurance of the slash will always be at 8 🙁

    Sloppy me...

  • RE: TSQL parsing out a URL

    Try this:

    DECLARE @URLTable TABLE

    (

    URLs VARCHAR(100)

    )

    INSERT INTO @URLTable

    SELECT 'http://www.google.com/pages?=hh'

    UNION ALL SELECT 'http://www.google.com'

    UNION ALL SELECT 'http://www.google.com/vd/hhh/pages?=yy'

    UNION ALL SELECT 'http://www.Adomain.com/pages?=hh'

    UNION ALL SELECT 'http://www.Adomain.com'

    UNION ALL SELECT 'http://www.Adomain.com/vd/hhh/pages?=yy'

    SELECT SUBSTRING( URLs , INDEX_SLASH...

Viewing 15 posts - 871 through 885 (of 1,923 total)