Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2016

    Unanswered: Microseconds in Date field


    We are updating bulk transactions in Sybase sql table. We have SYS_DATE column in table to which we are passing value getdate(). This is storing the date as 2016/03/10 09:30:54:730 AM. Since it is storing only milliseconds the records are duplilcated as below

    524846 000 000 000 2015/05/07 12:27:09:420 PM 111
    524846 000 000 000 2015/05/07 12:27:09:420 PM 114
    524846 001 004 001 2015/05/07 12:28:25:850 PM 813
    524846 000 000 000 2015/05/07 12:28:25:850 PM 910

    After googling I came to know if we use BIGTIME datatype we can have microseconds. I have tried this

    SELECT CONVERT(CHAR(30), getdate(), 40) which is gving 16-03-10 10:54:52.166000. But last three digits are always zero. How to get exact timestamp to be stored in database including microseconds.

    I am not sybase person. I am UNIX person. But One stored procedure in SYBASE is updating the data in table.

    Please give me the commands to store the microseconds in the table column. In update it is coded as SYS_DATE=GetDate(), What to code instead of this to get stored of microseconds as well.

    What is the command to display complete date and time including microseconds in sql. I tried select getdate()
    it is giving 2016/03/10 10:59:03:196 AM. Please help me with the command to get microseconds as well.


  2. #2
    Join Date
    May 2005
    South Africa
    Provided Answers: 1
    select convert(char(30),current_bigdatetime(),140)
     2016-04-04 12:06:52.132816

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts