Re: Adding function is being dumb
From: Ken Snell [MVP] (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 03/03/05
- Next message: scoopy2: "Re: Form for parameter query"
- Previous message: DanNeedsHelp: "Querying a combo box on a form in an ADP"
- In reply to: Roger Carlson: "Re: Adding function is being dumb"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Mar 2005 10:41:19 -0500
Yes, Double might cause a bit of rounding, though significantly less than
using Single (as I've found out the hard way :-( in an application).
Currency could work as well and would also greatly reduce rounding.
"Roger Carlson" <NO-Rog3erc-SPAM@hotmail.com> wrote in message
news:ub8oTw$HFHA.3588@TK2MSFTNGP14.phx.gbl...
> As I assumed. I only piped in because the field names led me to believe
> they were integer.
>
> However, another thought just occurred to me. Isn't it true that storing
> integer values in Double-precision variables and then doing math on them
> sometimes introduces rounding errors? I can't find my source, but the
> solution (as I recall) was to use Currency instead. Does this ring a bell
> with you?
>
> --
> --Roger Carlson
> Access Database Samples: www.rogersaccesslibrary.com
> Want answers to your Access questions in your Email?
> Free subscription:
> http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
>
>
>
> "Ken Snell [MVP]" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
> news:O5qrmU2HFHA.2564@tk2msftngp13.phx.gbl...
>> Agreed for an integer number ... in my post, I didn't want to assume that
>> the number was a whole number and then have an additional post about
>> truncation occurring.
>>
>> < g >
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
>>
>>
>> "Roger Carlson" <NO-Rog3erc-SPAM@hotmail.com> wrote in message
>> news:uyqwp91HFHA.1392@TK2MSFTNGP10.phx.gbl...
>> > If the fields hold integer values, I'd recommend using CLng instead of
>> > CDbl.
>> >
>> > --
>> > --Roger Carlson
>> > Access Database Samples: www.rogersaccesslibrary.com
>> > Want answers to your Access questions in your Email?
>> > Free subscription:
>> > http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
>> >
>> >
>> > "Ken Snell [MVP]" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
>> > news:OICc7w0HFHA.156@TK2MSFTNGP10.phx.gbl...
>> >> Sounds as if the query thinks the Apr On Hand and Apr Ordered Amount
>> > values
>> >> are strings, not numbers. I take it that these are parameters that you
>> > enter
>> >> when you run the query?
>> >>
>> >> Try this (using CDbl function to change the inputted values into
>> >> numbers):
>> >> EndMonth: CDbl([Apr On Hand])+CDbl([Apr Ordered Amount])
>> >>
>> >>
>> >> --
>> >>
>> >> Ken Snell
>> >> <MS ACCESS MVP>
>> >>
>> >> "nbuwalda" <nbuwalda@discussions.microsoft.com> wrote in message
>> >> news:B6CB069A-F042-4BE7-B802-5139054E9C1A@microsoft.com...
>> >> >I have to fields that data is inputted to and want to add them up and
>> >> >put
>> >> >the
>> >> > output in another field. My equation is as follows:
>> >> >
>> >> > EndMonth: [Apr On Hand]+[Apr Ordered Amount]
>> >> >
>> >> > I have my output field set to EndMonth but when I input values into
> the
>> >> > Apr
>> >> > On Hand and Apr Ordered Amount fields it doesnt add them, it
>> >> > combines
>> >> > them.
>> >> > Say I put a 2 in AOH and a 5 in AOA, instead of giving me seven it
>> >> > gives
>> >> > me
>> >> > 25. If I subtract, multiply or divide it works ok. Is there a
>> > different
>> >> > symbol I need to put in place of the +?
>> >>
>> >>
>> >
>> >
>>
>>
>
>
- Next message: scoopy2: "Re: Form for parameter query"
- Previous message: DanNeedsHelp: "Querying a combo box on a form in an ADP"
- In reply to: Roger Carlson: "Re: Adding function is being dumb"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|