Formatting dates on insert or update - Helprequired please

DATABASE

    Sponsored Links

    Next

  • 1. Gouranga
    Call out Gouranga be happy. Gouranga Gouranga Gouranga. Say Gouranga my friend.. Gouranga.......That which brings the highest happiness.
  • 2. VDBA
    hi can anybody tell me how to use VDBA , it takes to much time in activity i have installed ingres on windoews 98 , and want to use Vdba from it i have created vnode , able to connect , windows is showing all databses users etc , but when i perform say sysmod onto a database , screen appear PLEASE wait and nothing happen , i m using ingres login in vnode and ingres is running of TRU64 Unix server please help AJAY CHADHA ENGINEER (IT) IT DEPARTMENT ,NTPC TTPS ------------------------------------------------------------------------------ "Speed & Quality is essence of IT"
  • 3. Ingres Encoding Names, which one to USE ?
    Hi I am new in this forum and I need information about how non english Ingres users are setting the character set information for Ingres. Ingres supports several encodings and some of them have very specific name, as given in the gcccset.nam file. These encoding names should be selected at install time by a user based on what platform they is working on and what language they are using. I wish to find out for a given platform and language which standard code set corresponds to which of the Ingres characterset encoding names as defined in gcccset.nam file. I am interested in the following Ingres characterset names and the platform + codeset they are being used in. HEBREW PCHEBREW ARABIC GREEK ELOT437 DOSASMO ARABIC EBCDIC-ICL / EBCDIC-C DECMULTI KANJIEUC KOREAN SHIFTJIS CHINESES CHTEUC CSGBK CSGB2312 THAI ALT ANY Please let me know what is the operating system code set for which you have chosen the particular Ingres encoding, eg for KOREAN on Windows the operating system code set is MS 949 similarily on Windows Chinese machine the GBK code set encoding corresponds to CSGBK Ingres encoding and so on. Thanks S.Gupta

Re: Formatting dates on insert or update - Helprequired please

Postby Mike » Wed, 08 Aug 2007 18:02:09 GMT

The YYYY_MM_DD format works under all II_DATE_FORMAT's
so here is my solution:

select c(date_part('year', 'today'))+'_'+c(date_part('month', 'today'))
+'_'+c(date_part('day', 'today'))

or if you want leading zeros:

select  right(varchar(date_part('year', 'today')+10000),4) + '_'
        + right(varchar(date_part('month', 'today')+100),2) + '_'
        + right(varchar(date_part('day', 'today')+100),2)

Mike


Similar Threads:

1.[Info-Ingres] Formatting dates on insert or update - Helprequired please

2.[Info-Ingres] Formatting dates on insert or update - Help required please

3.Formatting dates on insert or update - Help required please

Hi Richard,

    Hope you've got your Jandals on for this one... :-)

    Why not use the simple method of SQL, here are two examples for DD-
MMM-YYYY and YYYYMMDD etc...

SELECT
    RIGHT('00'+VARCHAR(date_part('DAY',hht_start_date)),2)+'-'+
    RIGHT(LEFT('JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC,',
               (INT2(date_part('MONTH',hht_start_date)) * 4) - 1
              ),3)+'-'+
    RIGHT('0000'+VARCHAR(date_part('YEAR',hht_start_date)),4) AS
start_date1,

    RIGHT('0000'+VARCHAR(date_part('YEAR',hht_start_date)),4)+
    RIGHT('00'+VARCHAR(date_part('MONTH',hht_start_date)),2)+
    RIGHT('00'+VARCHAR(date_part('DAY',hht_start_date)),2) AS
start_date2,

   Just swap hht_start_date for 'today' or your local variable etc...

   Enjoy

Gary

4.[Info-Ingres] Formatting dates on insert or update - Help requiredplease

5.To insert Dates in a particular format (with day of the week)

6. INSERT and UPDATE of ALLBALLS/INFINITY dates and MOVE

7. INSERT and UPDATE of ALLBALLS/INFINITY dates and

8. INSERT and UPDATE of ALLBALLS/INFINITY dates and MOVE COLUMNS



Return to DATABASE

 

Who is online

Users browsing this forum: No registered users and 6 guest