...

View Full Version : Values of 8 and 9 are converting to 0?



SnotRockit
06-27-2006, 05:20 PM
I am working with comparing dates. The problem I am having is that August (08) comes AFTER July (07). However, it seemed to consider Aug (08) and Sep (09) to be earlier than Jan-Jul. When I took a look at the values, they were shown as...

July = "07"
August = "00"
September = "00"

Anyone know why this might happen? Is there a possible fix?

Any help is greatly appreciated. Thanks.


SnotRockit
:confused:

Beagle
06-27-2006, 06:15 PM
You should do a search for this very question. It has been answered twice in the recent past. One of those answers was last week.

The reason is because numbers prefaced with 0 are octal, and 08 and 09 are not valid octal values, so it chokes. You can fix this by doing Number('08') or whatever your variable is that stores '08' and you will get 8 back.

liorean
06-27-2006, 08:54 PM
SnotRockit: The answer to this question is in the FAQ.

If you want a more thorough explanation, see this textual explanation or this tabular breakdown.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum