Forum Stats

  • 3,854,417 Users
  • 2,264,366 Discussions
  • 7,905,684 Comments

Discussions

Varchar2 gets converted to DATE in EXCEL

MarcLaf
MarcLaf Member Posts: 182 Bronze Badge

Hi,

I have a report that outputs data to EXCEL format (spreadsheet). I have columns (ROOM and STORAGE AREA) that are declared as VARCHAR2 in the database.

Query from report:

SELECT vs.BSE_NAME BASE

    , LTRIM (vs.bld_no) BUILDING_NUMBER        

    , LTRIM (vs.bld_name) building

    , LTRIM (DECODE (:p_language

             , 'F', vs.rnm_name_fre

             , vs.rnm_name_eng) ) room

    , LTRIM (vs.rom_room_no) ROOM_NUMBER

    , LTRIM (DECODE (:p_language

           , 'F', vs.san_name_fre || ' ' || vs.sar_no

           , vs.san_name_eng || ' ' || vs.sar_no) ) STORAGE_AREA

    , LTRIM (vs.sar_no) STORAGE_AREA_NUMBER

    , (SELECT COUNT(*)

    FROM SAR, HLD 

    WHERE SAR.SAR_ID = HLD.SAR_ID

     AND SAR.SAR_ID = vs.sar_id) count_of_hmra

  FROM v_storage_areas vs

    , loc l

    , frm f

    , unt u

    , sec s

    , snm sn

  WHERE vs.loc_id = l.loc_id

   AND vs.FRM_ID = f.FRM_ID

   AND vs.UNT_ID = u.UNT_ID

   AND vs.SEC_ID = s.SEC_ID

   AND sn.SNM_ID = s.SNM_ID

When I execute this command in Sqlpplus:


When I look at the EXCEL file, the ROOM_NUMBER is converted to DATE... WHY?


Comments