[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Using the edit mask for date fields on Oracle -Reply



 sqr:
#if {sqr-database}=ORACLE
#include 'nls.h'
#endif
..
..
..
..
..
 #if {sqr-database}=ORACLE
to_char(targstartdate,'dd-Mon-yy')     &targstartdate
to_char(targcompdate,'dd-Mon-yy')     &targcompdate
to_char(schedstart,'dd-Mon-yy')       &schedstart
to_char(schedfinish,'dd-Mon-yy')     &schedfin
to_char(faildate,'dd-Mon-yy')       &faildate
 #endif




file nls.h:

begin-procedure set_nls_date_format
begin-sql
 alter session set nls_date_format = 'YYYY-MM-DD-HH24-MI.SS'
end-sql
 commit
end-procedure

Hope this helps


Wes Williams

>>> Anders Eriksson <anders.eriksson%TELE2.SE@internet.rkd.snds.com> 07/06/98
12:11pm >>>
Hello!

I have a problem. I am tying to convert a large number of reports frm
SQLBase to Oracle
and I can't get the formating of date formats on Oracle to work. I have the
folowing code:

begin-select
faildate       (,10)     edit 'yyyy-mm-dd hh:mi'        ! Won't work
statusdate
     print     &statusdate    (,27)      edit 'yyyy-mm-dd hh:mi'  ! Will
not work either
.....

When executing this code on the Oracle database i get the edit string
yyyy-mm-dd hh:mi
insted of the formated date. Since I am going to convert a large number
of reports I would like to avoid to rewrite every line where dates are
formated to:

to_char( faildate, {d_DateTimeMask} )         (,10)
to_char( statusdate, {d_DateTimeMask} )  (,27)

As far as I have understod it should be possible to use the edit comand for
 date fields for Oracle
databases as well.

I am using:
     Windows 95 and NT Clients
     SQR 3.0.13.2 for PC/Windows
     Oracle 7.3

Regards
Anders Eriksson