Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    Question Unanswered: Ingres and date formatting

    Hi all,

    A customer of mine is using an ingres database. I'm trying to extract the data and need to manipulate the dates in particular before adding to a Sybase database.

    The dates in the this ingres database seem to be stored in many fomats and makes manipulation (without writing a very good parser) difficult. I know in sybase we have a CONVERT function which creates a string containing the date in a known format.

    Is there an equivalent in INGRES?

    Failing that, perhaps returning the date diff with today can be used. Again, is there an equivalent date diff in INGRES and has anyone information on the format of the select command for that?

    Thank you for your help,


  2. #2
    Join Date
    Feb 2004
    I don't know of a convert function but perhaps some of this info will be helpfull.

    1) there is an II_DATE_FORMAT setting/variable that determines legal formats and what format is used by default. If not set, the default is the US format, which outputs as dd-mmm-yyyy (ex. 15-may-2004). So changing this variable will change how the date is displayed.

    2) you can cast a date to a char type. Like "select char(date('today'));", then you can use any of the string functions to manipulate the char string.

    3) Ingres has a number of date functions. To get a date diff, subtract the two dates. "select date('today') - date('15-may-2004')". The result is given in terms of days "164 days".

    Exactly what format do they need their dates in? If you can be more specific, we an help with an actual answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts