[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Formatting Dates in SQR V3 and Oracle -Reply
- Subject: Formatting Dates in SQR V3 and Oracle -Reply
- From: Cecilia Bigley <cbigle@CORP.ATL.COM>
- Date: Tue, 12 May 1998 09:18:07 -0700
John -
I work with Oracle Version 7.2.3 and SQR Version 3 - I
have found in most cases, the commands work better if
you use the power of the Oracle SELECTs to do your date
formatting rather than the LET command.
i.e.
SELECT
to_char(WO.due_date,'MM/DD/YYYY') &formatted_date
FROM EWM_WORK_ORDERS WO
instead of
let $due_date = edit(&DUE_DATE, 'DD/MM/YYYY')
The SELECT always works where I don't always get
consistent results the other way. I hope this helps.
Cecilia Bigley
----------------------------------------------
Hi, I'm having some basic problems formatting dates in
SQR. Any info will
be appreciated.
I'm reading several fields of type Date from an Oracle
Database. The code
is
begin-select on-error=SQL_Error ('Y')
WO.WORK_ORDER_NO &WORK_ORDER_NO
WO.DESIRED_DATE &DESIRED_DATE
WO.DUE_DATE &DUE_DATE
WO.LATE_DATE &LATE_DATE
FROM EWM_WORK_ORDERS WO
WHERE WO.WO_YR=#WO_YR AND
WO.WO_NO=#WO_NO AND WO.WO_SEQ=#WO_SEQ
end-select
If I print any of the dates the result looks like 16-APR-98.
I want to
display 04/16/1998.
I have tried using an edit mask on LET, MOVE and
PRINT. The code looks
something like
print &DUE_DATE (1,1) edit 'DD/MM/YYYY' or
let $due_date = edit(&DUE_DATE, 'DD/MM/YYYY') or
move &DUE_DATE to $due_date DD/MM/YYYY
in all cases when I print what results is DD/MM/YYYY.
What am I doing wrong?
Thanks in advance, John Walker