Focal Point
[CLOSED] (FOC1426) DATA ELEMENT VALUE TOO BIG FOR SEGMENT/FIELD

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2787078196

October 25, 2019, 02:17 PM
Rageoftheage
[CLOSED] (FOC1426) DATA ELEMENT VALUE TOO BIG FOR SEGMENT/FIELD
Hi All,

I am trying to format a date for excel output as a date and not a string.

I am using embedded SQL...

'to_Date(sm.dep)' works properly but I want to format it differently. If I use 'to_Date(sm.dep, 'mm/dd/yyyy')' I get the error in the subject title.

Does anyone have any insight on this? Thanks.

This message has been edited. Last edited by: FP Mod Chuck,
October 25, 2019, 07:39 PM
Hallway
Could you provide a little more detail?
Is it a SQL Passthrough?
What is the db you are connecting to (different databases have slightly different SQL syntax ie: SQL Server, Oracle, Postgress, etc.)?
Have you done a SQL trace?
Can you provide the procedure code?


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
October 25, 2019, 08:47 PM
Doug
Consider this: This query shows the same date, but with the format specified.

SELECT TO_DATE('10-25-2019', 'MM-DD-YYYY') AS date_test
FROM DUAL;

The data, 10-25-2019, can be a field.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 30, 2019, 11:24 AM
Wep5622
You're trying to make the database format a text according to a date-format specification that does not match that text.

Dates don't have a "format", it's just a big number. What you see in clients is an interpretation of a date converted to text, usually formatted according to your localization settings or explicitly converted to text using a specific format.

If you want a formatted date, then you must convert it to text using to_char(a_date, format_specification), or you must set your client's localization according to the desired format so that the client handles the conversion appropriately.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :