If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > Ingres and date formatting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-04, 10:43
armitage.shanks armitage.shanks is offline
Registered User
 
Join Date: Oct 2004
Posts: 1
Question 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,

Shanks!
Reply With Quote
  #2 (permalink)  
Old 10-26-04, 12:29
weaselboy1976 weaselboy1976 is offline
Registered User
 
Join Date: Feb 2004
Posts: 18
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On