Forum Replies Created

Viewing 15 posts - 1,246 through 1,260 (of 1,923 total)

  • RE: How to get a substring between two characters?

    Eugene Elutin (8/16/2010)


    Personally, I wouldn't use UDF for the requested task, even it's look neater, it will be slower than just doing it in-line....

    Eug, I knew you guys will hate...

  • RE: How to get a substring between two characters?

    Or even betters solution:

    Functions Script:

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

    BEGIN

    PRINT 'FUNCTION : dbo.iTVF_GetStringBetween2Chars ALREADY PRESENT, SO DROPPING IT..'

    DROP FUNCTION dbo.iTVF_GetStringBetween2Chars;

    PRINT 'CREATING FUNCTION : dbo.iTVF_GetStringBetween2Chars'

    END

    ELSE

    BEGIN

    PRINT 'FUNCTION : dbo.iTVF_GetStringBetween2Chars IS...

  • RE: How to get a substring between two characters?

    WOW.... THIS IS MY 1000th POST... HAPPPY ME!! :w00t: :cool::cool:

    Take this brother:

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

    BEGIN

    PRINT 'FUNCTION : dbo.udf_GetStringBetween2Chars ALREADY PRESENT, SO DROPPING IT..'

    DROP FUNCTION dbo.udf_GetStringBetween2Chars;

    PRINT 'CREATING FUNCTION...

  • RE: Convert from row to column

    It can be done quite easily.. But we need ready to use data to start working on it..

    please go through this following article and help us help you!

    CLICK...

  • RE: Delete Rows

    So confusing the requirement is, bryant!

    Can u please elaborate ?

    As a side note, include the status column along with the driver ID in the Group BY dint solve your request?

    We...

  • RE: I need a better way to do this

    You have come this far, why not go one step further and post some DDL and DMLs for your request . Please go through the following article on how to...

  • RE: Increment 1 min when matching start and end time

    LutzM (8/11/2010)


    ColdCoffee (8/10/2010)


    LutzM (8/10/2010)


    @ColdCoffee:

    Sorry for sending you in the wrong direction!

    Not at all, Lutz. I already coded the sample data with IDENTITY column , so that i will get a...

  • RE: Increment 1 min when matching start and end time

    drew.allen (8/10/2010)


    ColdCoffee (8/10/2010)


    INNER JOIN will fail with the following sample data :

    A CROSS JOIN with a WHERE clause that references both tables is essentially the same as an INNER JOIN

    Drew

    True,...

  • RE: Using composite key to update

    Something like this ?

    declare @test-2 table

    (code varchar(2) not null,

    Rate varchar(10) not null,

    Stardate datetime Not nUll,

    Enddate datetime Null,

    Importdate datetime null)

    INsert iNTO @test-2 VAlues( 1 ,4200,'2004-01-01',Null,null)

    INsert iNTO @test-2 VAlues(...

  • RE: Increment 1 min when matching start and end time

    LutzM (8/10/2010)


    Drew,

    I guess the Row_Number approach I was hitting for was overdesigned for the task...

    You're absolutely right, for the given task a simple join on the time columns would be...

  • RE: Increment 1 min when matching start and end time

    drew.allen (8/10/2010)


    You're not using your row number anywhere in your subsequent query, so why bother calculating it in the first place? And, since you don't need to calculate the...

  • RE: Increment 1 min when matching start and end time

    And i had another post form another dude asking exactly the same question... i dont remember that post.. probably u can find more explanations and code in that as well...

  • RE: Increment 1 min when matching start and end time

    If you dont have an ID column, then as Lutz suggested, use ROW_NUMBER as given below.

    declare @tab table

    (

    rid int identity(1,1),

    starttime datetime,

    endtime datetime

    )

    insert into...

  • RE: Increment 1 min when matching start and end time

    Sagar, try this:

    declare @tab table

    (

    rid int identity(1,1),

    starttime datetime,

    endtime datetime

    )

    insert into @tab

    select '2010-08-10...

  • RE: Insert enddate using startdate

    Aspg (8/10/2010)


    I dont have identity column in the table

    Why not an IDENTITY column or even an ID column to mark rows ... hmmm.. anyways, take this ; this uses...

Viewing 15 posts - 1,246 through 1,260 (of 1,923 total)