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
1688 bytes
1688 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: Allan Bertelsen
Date: Wed, 26 Nov 1997 00:00
Date: Wed, 26 Nov 1997 00:00
34 lines
1999 bytes
1999 bytes
Formating a field does not remove decimals, it just shows the number in another way. To solve the problem you use a formula in a query. If the field's name is Number, you create a calculated field named NewNumber by the statment: NewNumber: Int([Number]) The If-statement is used in a similar way: Tax: If([Value]>0 , [Value]*0.5 , 0) The field Tax is 50% of Value if Value is positive. Allan Bertelsen WM-Data BFC Denmark Alan Steele <asteele@welpac.com.au> wrote <880514703.64503@comcen.comcen.com.au>... > Hey, > ... 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. > > 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
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