Thread View: comp.databases.ms-access
2 messages
2 total messages
Started by Alan Steele
Wed, 26 Nov 1997 00:00
Rounding-down & IFs?
Author: Alan Steele
Date: Wed, 26 Nov 1997 00:00
Date: Wed, 26 Nov 1997 00:00
19 lines
1653 bytes
1653 bytes
Hey, I'm in the process of inserting the Luhn algorithm (for basic credit card checking) into an existing database but I'm having some problems removing the decimal places after performing one of the calculations. I've tried formatting to "0" and using "0" decimal places, both of which round the number up. I am using the design view for the query but wouldn't be opposed to using SQL if someone should volunteer some SQL info. The other question I have is on how to use "If" statements within a query? Any help would be much appreciated. Thanks in advance, Alan Steele, Systems Admin. asteele@welpac.com.au
Re: Rounding-down & IFs?
Author: Nigel King
Date: Thu, 27 Nov 1997 00:00
Date: Thu, 27 Nov 1997 00:00
58 lines
2669 bytes
2669 bytes
Alan- Function TruncAU (value) 'this function will truncate to 2 decimal places the underlying value in a currency field 'it is designed to operate as an AfterUpdate property value = Int(value * 100) / 100 End Function It is a routine I obtained from another Access developer. I am not too conversant with modules but presume that modifying this to read: value = Int(value) will truncate. I have other routines that I use for Rounding. Let me know if these might be helpful. Ref your If in a query- Where are you trying to use this? As an update result for example or in the criteria? Give me some pointers and I might be able to help you, I have used a number of these. Email me - Nigel@landaur.demon.co.uk Look forward to hearing fro you. Regards. In article <880515983.593058@comcen.comcen.com.au>, Alan Steele <asteele@welpac.com.au> writes >Hey, >I'm in the process of inserting the Luhn algorithm (for basic credit card >checking) into an existing database but I'm having some problems removing >the decimal places after performing one of the calculations. > > >I've tried formatting to "0" and using "0" decimal places, both of which >round the number up. > > >I am using the design view for the query but wouldn't be opposed to using >SQL if someone should volunteer some SQL info. > > >The other question I have is on how to use "If" statements within a query? >Any help would be much appreciated. Thanks in advance, >Alan Steele, Systems Admin. >asteele@welpac.com.au > > > -- Nigel King Landaur Ltd computing@landaur.demon.co.uk
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads