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

Re: Need help Datefield Retrieval like this mmddyyyy



Another Solution, maybe not always the best, but a different twist on date
formatiing (For Oracle Databases). This works fine if you want all your
dates in this format for the session, but do not want to alter the date
format for the database. Heres the code...

BEGIN-SETUP
BEGIN-SQL
ALTER SESSION SET NLS_DATE_FORMAT='MMDDYYYY'
END-SQL
END-SETUP

BEGIN-PROGRAM
  do MAIN
END-PROGRAM

BEGIN-PROCEDURE MAIN
BEGIN-SELECT
TABLE_DATE_FIELD &date
FROM TABLE_NAME
WHERE CONDITIONS = CONDITIONS
END-SELECT
END-PROCEDURE MAIN