The Mother Board forums. Free tech support, motherboard ID, and more.
It is currently Sun Jul 12, 2020 1:35 pm

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: access calculation
PostPosted: Sun Dec 04, 2005 11:46 am 
Black Belt 4th Degree
Black Belt 4th Degree

Joined: Sun Dec 28, 2003 8:26 pm
Posts: 4941
Location: Norwich, UK
I'm trying to add a fine calculator to a database. For example, if it is a week overdue the fine is £1. I tried using "date<[DateDue] = 1, but I don't know what field to put it into (validation, default value, etc)



Jocuri cu impuscaturi si alte genuri, pentru toate varstele doar pe acest link - distractie si amuzament garantat!

Reply with quote  
 Post subject:
PostPosted: Mon Dec 05, 2005 5:40 am 
Brown Belt
Brown Belt

Joined: Tue Jul 27, 2004 10:41 am
Posts: 327
Location: Houston
Normally you would not put something like this into a database field property like validation or default value. The default value would calculate the fine once when the record was created but not after that. Since the fine would change on a weekly basis you need some sort of procedure to go through the database and calculate it for each record.

I would normally do this based on some sort of event like a button click or perhaps when a record is displayed on screen you could make the calculation. It could also be done in a query by using date()-[duedate] to give you the number of days and then dividing by 7 for the number of weeks and multiply by the fine.

There are numerous ways to do this but it really depends on how you are setting up and displaying the records and whether or not you are using forms or just a query to display the raw data.

I use Access as a development tool and create applications for end users. But other people use Access to interact with the data without using forms and perhaps building or changing queries on the fly. How you do this is determined by the methods you are using to display the data.


Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group