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 > DB2 > CHAR function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-09-03, 10:43
RudiVdm RudiVdm is offline
Registered User
 
Join Date: Sep 2003
Posts: 17
CHAR function

If I use the CHAR function to convert a date field to a text field (CHAR(EFECT_DATE,ISO), and access that field through a linked server on MSSQL Server, i only get values in that field appearing like : 0xF0F0F0F160F0F160F0F1 .

It would appear that the first '0x' is irrelevant, and then that what should be '3's are replaced with 'F's in some kind of hex translation.

Anyone know why?
Reply With Quote
  #2 (permalink)  
Old 10-09-03, 12:50
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Is this related to your other thread called "Convert field but retain format"?

I don't know anything about how a “linked server on MSSQL Server” works, but keep in mind that date fields are stored internally as 4 bytes (in a compressed format) and they should be translated to the desired text format only by the final DBMS that displays the data.

The internal representation of the data does not have any knowledge of ISO, USA, etc formatting. It is only when the data is displayed (or returned to an application program) that the conversion to text (with dashes, slashes, periods, etc) takes place.

This assumes that you want MSSQL Server to treat the column as a date and not a text value.
Reply With Quote
  #3 (permalink)  
Old 10-10-03, 03:57
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
Are you selecting your data from a DB2 UDB for zOS/OS390? Your data in hexadecimal format looks like '0001-01-01' and this is the "default" date value that db2 "saves", when a new date column (WITH DEFAULT) is defined in a table which has already data.
HTH
__________________
Rodney Krick
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