Re: Date Formats within Informix.
Posted in 1996
106005.3077@compuserve.com (John Brownlee) wrote: :Morning everyone, :We are using a format for a date of "DDMMMYYYY" in the form files of our :system. :I have tried unsuccessfully to use this Date format in the DBDATE :environment :variable, but it does not work, after talking to Informix Tech Support, :they said that :"DBDATE only supports numeric date types". :Our company provides Software to both US and European Customers, and if we :could :use DBDATE or something similar to control this it would be very helpful. :The end result :that is required is something like the following :- : In US :- AUG061996 : In Europe :- 06AUG1996 :Informix :- SE ENGINE 5.06 & 4GL 4.14 Informix tech support are right (of course) that DBDATE only supports numeric date types. With other words, there is *no* solution for standard input statements using a standard date variable with no tricks. Why you would want your customers to actually type in this format I have no clue. It's so hard. But if you do you could easily use a char(9) variable and have two functions that convert this from and to a date variable. You would tell this function via a global variable (set at the start of your program from an environement variable or some other means) whether a US or European format is wanted. You would probably want to use the date to char function for display and print as well. Another matter is that 06AUG1996 isn't the right format for all of Europe. We would understand it in Norway, but Sweden would use 1996AUG06 as several other countries would. You would have to be in a special industry tough for anyone in our corner of the globe to understand that they had to type (or even read) dates with names like this. All numeric is the name of the game here. And DBDATE than gives you the options of different formats including , - or / between the parts as they are used in each contry. Nils.Myklebust@ccmail.telemax.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company