separating a field of type date

  • I have a date fields and I want to separate the time and date for a field contains just the date and other fields contains the time

    exemple :

    fc_date

    --------

    14/12/2004 15:34:00

    get this

    fc_date fc_time

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

    14/12/2004 15:34:00

  • Try these:

    select CONVERT ( date , '12-14-2004 15:34:00')

    select CONVERT ( time , '12-14-2004 15:34:00')

    But, why would you want to do it ? Store dates fully!

  • If this is for display purposes, fine. If this is for storage please reconsider, it will just make things harder to work with.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • thanks:-)

  • This was removed by the editor as SPAM

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

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