SQL Time

  • hi folks,

    this is my first query in this fourm. i have one field in my table named emp_time(as datetime) which stores time entered by the user.

    the problem is when i try to retrive time from database its gives me date also whci i dont want.

    i have tried this

    SELECT Today=convert(varchar, GETDATE(),114)

    but this also didnt work.

    pls reply urgently.

    thanks in advance.

  • SELECT Today=convert(varchar, GETDATE(),114)

    returns

    Today

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

    13:52:08:233

    seems fine to me - what format do you want it in??

  • GRN

    This is ok as i also write in my earlier post. but when i uses this with my column name then it gives error say my column name is "time_challan"

    and if i use this

    select convert(time_challan,114) from tableA

    then it gives error

    Type time_challan is not a defined system type.

  • select convert(time_challan,114) from tableA

    you've missed the first parameter of convert

    should be

    select convert(varchar,time_challan,114) from tableA

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply