Date calculation gives strange format
Posted in 1997
Hi, 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 The first two are what I would expect and desire from this sort of statement. The third is completely useless to me! DBDATE has no effect on the output of the third statement, and I suspect the influence of the datetime datatype (this looks to me like datetime year to day). The problem is that we have very few datetime columns in our database (third party application, no way of changing them even if we wanted that sort of accuracy - which we don't!) and we want to use the output of a statement like this to compare with dates in our data. Does anyone know how to get the third statement to output in DMY4/ format? Thanks in advance, Richard.