Forum Replies Created

Viewing 15 posts - 31 through 45 (of 139 total)

  • RE: date format

    Hi Edward,

    Another good way. Thanks.

    But i feel

    select convert(datetime,convert(varchar,getdate(),112))

    is better and easier to understand.

    But whtz abt performance?:w00t:

  • RE: Need output

    Matt Whitfield (9/22/2009)


    Erm... there is another way - check out ROW_NUMBER, OVER clauses and the PARTITION BY statement.

    Hi Matt,

    Can u describe some more on those issue?

  • RE: Need output

    Steved,

    Great help. So, there is no way apart from INNER join...anyway, that's fine for me.

    Thanks again.

  • RE: INDEXES

    mroja_2005 (9/22/2009)


    What makes the difference between the below two create index statements????

    In my scenario, the second create index statement is giving me better performance.

    Conceptually, what is difference??? Why do we...

  • RE: Need output

    steveb. (9/22/2009)


    You can do the same with IN

    select name, value, version from #temp

    where name in (select name as version from #temp group by name)

    AND version in (select max(version) as...

  • RE: Need output

    Hi,

    1 more question:

    Shall I do the same with IN? (Plz dont ask why, its simply fro knowlwdge)

    I have used the following query, but its giving syntax error:

    select name, value, version...

  • RE: Need output

    Hi Steveb,

    Thanks 4 ur reply.

    This is exactly what I need.

    Thanks again.

  • RE: date format

    Fausto Echevarria (9/18/2009)


    i think this is what you want..

    select convert(datetime,convert(varchar,getdate(),112))

    and you will get this...

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

    2009-09-18 00:00:00.000

    (1 row(s) affected)

    Hi Fausto,

    That is exactly my wantsome. Thanks a ton.

  • RE: date format

    Fausto Echevarria (9/18/2009)


    i think this is what you want..

    select convert(datetime,convert(varchar,getdate(),112))

    and you will get this...

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

    2009-09-18 00:00:00.000

    (1 row(s) affected)

    Hi Fausto,

    That is exactly my wantsome. Thanks a ton.

  • RE: date format

    Dugi (9/18/2009)


    Hmm wait a min;

    SELECT * FROM Fiscal_Year

    WHERE CONVERT (varchar(10),'2009-09-01 00:00:00.000', 112)

    BETWEEN CONVERT(varchar(10), start_date,112) AND CONVERT(varchar(10),(end_date - 1),112)

    SELECT * FROM Fiscal_Year

    WHERE '2009-09-01 00:00:00.000'

    BETWEEN start_date AND (end_date - 1)

    '2009-09-01 00:00:00.000' -...

  • RE: date format

    Dugi (9/18/2009)


    When you use the CONVERT function try to not determine the number of characters during conversations

    try like this CONVERT(VARCHAR, DATE_FIELD, format)!

    Hi Dugi,

    There is no difference if we are not...

  • RE: date format

    Hi Dave,

    It works fine. Even I have used the following code

    declare @start_date varchar(23)

    select @start_date = REPLACE((CONVERT (varchar(10), '2008-10-09 00:00:00.000',112) + ' 00:00:00.000'),'-','/')

    print @start_date

    But I feel ur...

  • RE: Date conversion

    Dugi (9/18/2009)


    The solution is here

    This thread should be closed!

    Hi Dugi,

    its a server error, thats why posted twice. Anyway got the solution, thanks.

  • RE: Function debugging

    Mahesh Bote (9/1/2009)


    [font="Verdana"]To do this you need to use Dynamic SQL inside the SProc.

    Mahesh[/font]

    Thnaks mahesh for ur reply...I wll try the method.

  • RE: Function debugging

    Mahesh Bote (8/31/2009)


    [font="Verdana"]

    arup_kc (8/27/2009)


    But Chirag,

    You cant call a function from a SELECT statement and send a column name as a parameter.

    Shall we sens a column name as a parameter in...

Viewing 15 posts - 31 through 45 (of 139 total)