Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006

    Unanswered: current year to second

    I am trying to port the following SQL statement from informix to SQL Server 2000. I do not have access to an informix database, so I cannot try out the following SQL statement to see what it does.

    select kingdom_id ,current year to second,wb_id
    from wrk_taxonomic_unit
    where rank_id = 10

    I am trying to find a replacement for the informix specific command "current year to second" in SQL Server. I am thinking of using the GetDate() function from SQL Server. GetDate would return a response something like this:

    2000-07-31 20:01:19.957

    Could someone tell me what current year to second returns so that I can see if the GetDate() function meets my needs?

  2. #2
    Join Date
    Aug 2006
    The Netherlands

    CURRENT returns the instant expressed in datetime format. The default format for CURRENT is 'datetime, year to fraction', which has the format: "2006-10-24 23:52:16.123". In your query the precision is determined to 'year to second', which will show the instant as "2006-10-24 23:52:16". So if you want to meet the output you described for GetDate you only have to use
    SELECT kingdom_id, current, wb_id
    Last edited by Tyveleyn; 10-24-06 at 18:01.

Posting Permissions

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