cancel
Showing results for 
Search instead for 
Did you mean: 

Standard database function TO_CHAR() usage

Former Member
0 Kudos
2,169

Dear Experts,

I would like to use standard database function TO_CHAR() in order to format TIMESTAMP(6) field in date format only. I want to execute the query below:

SELECT WAREHOUSE, SSCC, MATERIAL, QUANTITY, TO_CHAR( EXPIRYDATE ,'YYYY-MM-DD'), STOCK_STA FROM SAPSTOCKREPORTITEM;

After research I found the note 2072891 2072891 - How-to use database standard functions in query to database using Receiver Communication C... where are mentioned two attributes hasQuot and metadata. I followed the steps but I did't succeed.

My systems are PO 7.4 Java stack only and Oracle 11g.

Has anyone succeed to use the function TO_CHAR?

Best regards,

Rossitsa

View Entire Topic
Matija_Liber
Explorer
0 Kudos

Hi,

You need at the part "TO_CHAR( EXPIRYDATE ,'YYYY-MM-DD')" add the attribute in double quotation marks "EXPIRYDATE". So You dont need change the response and You will not have problem with "<TO_CHAR(TRUNC(EXPIRYDATE))>13-SEP-16</TO_CHAR(TRUNC(EXPIRYDATE))>".

So Your select should look like:

SELECT WAREHOUSE, SSCC, MATERIAL, QUANTITY, TO_CHAR( EXPIRYDATE ,'YYYY-MM-DD') "EXPIRYDATE", STOCK_STA FROM SAPSTOCKREPORTITEM;