If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > current year to second

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-23-06, 17:10
llzamboni llzamboni is offline
Registered User
 
Join Date: Oct 2006
Posts: 4
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?
Reply With Quote
  #2 (permalink)  
Old 10-24-06, 17:54
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
Hi,

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
Code:
SELECT kingdom_id, current, wb_id
Regards

Last edited by Tyveleyn; 10-24-06 at 18:01.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On