Date/Days functions
Posted: Wed Oct 14, 2009 2:29 pm
Hi all,
Prior to BR 4.18, using the DAYS function on a string would return an error.
Now it does not. I have no problem with this because it allows us to do date validate on strings. It's a good thing (in the words of Martha Stewart).
days("122509","mdcy") returns 40171 This is correct.
But if you run days on a blank string, it doesn't return 0 as I would assume. It returns 40086 (or October 1, 2009) Why is that? I have programs where dates that should be blank are being initialized to 10/01/09 instead. This can't be right, can it? I'm fixing this by coding around it, but it seems like a bug to me and now I'm in the process of tracking down every place where I depended upon the result being 0.
If it's not a bug, can someone explain it to me? This happens in 4.18 and 4.2 as far as I can tell. My systems written in 4.03 did not do this, but I don't think you could do any date functions on strings back then.
-- Susan
Prior to BR 4.18, using the DAYS function on a string would return an error.
Now it does not. I have no problem with this because it allows us to do date validate on strings. It's a good thing (in the words of Martha Stewart).
days("122509","mdcy") returns 40171 This is correct.
But if you run days on a blank string, it doesn't return 0 as I would assume. It returns 40086 (or October 1, 2009) Why is that? I have programs where dates that should be blank are being initialized to 10/01/09 instead. This can't be right, can it? I'm fixing this by coding around it, but it seems like a bug to me and now I'm in the process of tracking down every place where I depended upon the result being 0.
If it's not a bug, can someone explain it to me? This happens in 4.18 and 4.2 as far as I can tell. My systems written in 4.03 did not do this, but I don't think you could do any date functions on strings back then.
-- Susan