cancel
Showing results for 
Search instead for 
Did you mean: 

Using date with month as 00 returns January

0 Kudos
1,235

I am trying to use sa_rowgenerator and am seeing some odd behavior concerning dates.

SELECT dateformat ( cast ('1998/00/01' as date ), 'yyyy/mm/DD' ); <- Returns January 1, 1998
SELECT dateformat ( cast ('1998/01/01' as date ), 'YYYY/MM/DD' ); <- Returns January 1, 1998

My issue is that when I'm using the sa_rowgenerator for two months of different years (e.g. Dec 2018 - Jan 2019), I'm getting duplicates for January. Is there any way to turn off this behavior?

Vlad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Did you put MM and mm as month intentionally?

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

FWIW, with V16.0.0.2704, the first returns SQLCODE = -157 ("Cannot convert '1998/00/01' to a timestamp").

As stated in that (related?) FAQ, this seems to be a bug in v17. What version do you use?

0 Kudos

I'm also using v17, which is likely where the issue is. Any ideas on when this will be fixed?

VolkerBarth
Contributor
0 Kudos

Hm, don't know as I'm just another customer – but I assume the SQL Anywhere folks like Mark will add details in the mentioned FAQ.

Breck_Carter
Participant