| re: A97 overflow error returned when trying to calculate 192/(24*60*60) - why?
"MLH" <CRCI@NorthState.net> wrote in message
news:j83uh11u4imvau7n7vq8ms3o7jomnmc4kt@4ax.com...[color=blue]
> On Wed, 7 Sep 2005 10:34:56 -0500, "paii, Ron" <paii@packairinc.com>
> wrote:
>[color=green]
> >
> ><lesperancer@natpro.com> wrote in message
> >news:1126069306.909737.300130@g47g2000cwa.googleg roups.com...[color=darkred]
> >> (24 * 60 * 60) must be trying to evaluate to an integer
> >>
> >> 192 / (cdbl(24) * 60 * 60) seems to work = 2.22222222222222E-03
> >>
> >> but I don't know why
> >>[/color]
> >
> > (24 * 60 * 60) = 86400 which is a bigger number then an Integer can[/color][/color]
hold.[color=blue][color=green]
> >
> > (cdbl(24) * 60 * 60) converts it to a double which can hold 86400
> >[/color]
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I was thinking that declaring NewOutRefDate As Variant would take
> care of any memory allocation requirements. I guess I was wrong. It
> does seem strange, though. A variant is the one variable type that
> is big enough to manage any of the others.[/color]
A variant will store anything, but Access creates temporary storage while
doing math functions.
24, 60, 60 are all Integer so Access creates an Integer to store the
calculation,
then fails when the result overflows the Integer. |