Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    106

    Unanswered: Fine Calculations

    i am trying to create a query that will calculate the fine when an overdue library book is returned. i have created two select query. the first one uses the formula below to calculate how mant days late the book is:

    Days Late: DateDiff("d",[Date Due Back],Now())

    and the second select query calculates the fine:

    Expr1: IIf([Days Late]<7,0,IIf([Days Late]<14,0.3,IIf([Days Late]<21,0.6,IIf([Days Late]<28,1,IIf([Days Late]<56,1.5,IIf([Days Late]>56,3))))))

    when i use a command button on a form, it runs the query but just comes up with a list of fines. how can i make it so that the fine will be placed into the "Fine" field of the Loan table?

    i think i have to use an update query but i dont know how

    PLEASE HELP

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    use a dlookup to get the fine for the current book or put the second query into the form record source query with an inner join and fine should show once the DateReturned is filled in. Now() would have to be replaced with DateReturned.

  3. #3
    Join Date
    Jan 2004
    Posts
    106
    how do i do the inner join thing?

  4. #4
    Join Date
    Feb 2004
    Location
    Houston TX
    Posts
    23
    The inner joinin is done in the GUI of the querey wizard in access. once you add the tables in there, all you need to do is drag and drop the relationship between the table fields. Right click on the relation and then go to properties, there you can identify exactly all inner or outer joins.

    Another way of doing that is to right click in the query design mode and going to SQLView and doing it manually.

    Hope this helps
    Believe Everybody Trust Nobody

  5. #5
    Join Date
    Jan 2004
    Posts
    106
    im sure it will, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •