Results 1 to 2 of 2
  1. #1
    nganesha is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    2

    Need suggestions on splitting a row in a table into 2 or more rows

    Hi,



    I am working on a project that requires to calculate interest on the amount. There are 2 tables, 1 with Interest rate for a product for different and periods and another is product table with amounts in different period.

    Table 1 (Rates table)

    Product From To Rate
    1111 1/1/2012 1/20/2012 .75
    1111 1/20/2012 1/28/2012 .50
    1111 1/28/2012 4/6/2012 .40

    Table 2 (Product table)
    Product From To Amount
    1111 1/1/2012 1/17/2012 10000
    1111 1/17/2012 1/24/2012 15000
    1111 1/24/2012 2/25/2012 20000


    What i need to do is to calculate interset based on the above 2 table and insert into another table (Interest). However, the problem is with identifying correct rates for the periods in Table 2.

    Eg.
    for period 1/1 to 1/17: applicable rate would be .75
    for period 1/17 to 1/24: From 1/17 to 1/20 the rate would be .75 and from 1/20 to 1/24 it would be .50

    this is what i want to achieve, basically to split the period between 1/17 to 1/24 into 2 so that appropriate rate can be applied.

    Have not been able to visualize how to achieve this. Any help would be appreciated.

    Thank you,
    Navin

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    I recommend writing a custom function to accomplish determining the correct rate(s) for each record and return the calculated value.

    Overlapping To/From dates in data might cause issues.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Table rows to columns
    By Rhino373 in forum Programming
    Replies: 5
    Last Post: 12-22-2011, 01:44 PM
  2. Need suggestions
    By seth.murphine in forum Forms
    Replies: 0
    Last Post: 04-18-2011, 08:04 AM
  3. overwriting table rows
    By VickyC in forum Forms
    Replies: 2
    Last Post: 09-23-2010, 07:58 AM
  4. Looking for suggestions
    By jonesy29847 in forum Access
    Replies: 4
    Last Post: 07-06-2010, 06:53 PM
  5. Splitting a table into chunks
    By TheShabz in forum Queries
    Replies: 3
    Last Post: 02-18-2010, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums