Re: Date calculation gives strange format
Posted in 1997
Topics: SQL Development & Query Writing
Richard Thomas wrote: > > This is probably a "feature", but I'll ask anyway. I've been experimenting > with date calculations, and I'm getting some odd results. Check out the > following select statements: > > select date('1/4/1997') from uniq; > select date('1/4/1997') + 1 from uniq; > select date('1/4/1997') + 1 units month from uniq; > > (uniq is just a table with one column and one row - useful for this type of > test!) > > These give the following output: > > 01/04/1997 > 02/04/1997 > 1997-05-01 > > Does anyone know how to get the third statement to output in DMY4/ > format? How about: select date(date('1/4/1997') + 1 units month) from uniq; Hope that helps, -- Mark. +------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +-----------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work, force it! | |Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!| |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+-----------------------------------------+