Results 1 to 3 of 3
  1. #1
    shah1419 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    30

    Balance Insert

    Dear,the below query insert fine when the ome record exist. INSERT INTO Fees ( [GR No], Class, Tuition, FMonth, TMonth, [Year], Transport, Arrears )SELECT [Fee Student].[GR No], [Fee Student].Class, [Fee Student].Tuition AS Tuition, [fee insert].FMonth, [fee insert].TMonth, [fee insert].Year, [Fee Student].Transport, Baal.[bala]FROM [fee insert], [Fee Student], BaalWHERE ((([baal].[gr no])=[fee student].[gr no]));But when i want to create fresh new record which has no previous balance it did not work...please hel me to solve this issue. i have attached two pictures. First when when no record exist(fresh entery).Second picture shows the all enteries...
    Attached Thumbnails Attached Thumbnails 1.JPG   2.JPG  

  2. #2
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    This insert query is probably not doing what you think it's doing, and it is probably not working correctly.
    Code:
    INSERT INTO Fees 
      ( 
      [GR No], 
      Class, 
      Tuition, 
      FMonth, 
      TMonth, 
      [Year], 
      Transport, 
      Arrears )
    SELECT 
      [Fee Student].[GR No], 
      [Fee Student].Class, 
      [Fee Student].Tuition AS Tuition, 
      [fee insert].FMonth, 
      [fee insert].TMonth, 
      [fee insert].Year, 
      [Fee Student].Transport, 
      Baal.[bala]
    FROM 
      [fee insert], 
      [Fee Student], 
      Baal
    WHERE 
    ((([baal].[gr no])=[fee student].[gr no]))
    If you have three [fee student ] records that each have a [baal] record, and five [fee insert] records, then this INSERT statement will insert fifteen records into the [Fees] table. Is that what you were trying to do?

    Or will there always be only one [fee insert] record? And will there only be [baal] records for the accounts you are trying to enter?

    You definitely must have a [Fee Student] record and a [baal] record for each student before that code will add anything to the Fees table.

    By the way, if you use the word CODE in square brackets [] in your post before you put code, then /CODE in square brackets afterward, then the forum software will leave your code alone so it's readable instead of squished together.

  3. #3
    shah1419 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    30

    Balance Insert

    Or will there always be only one [fee insert] record? And will there only be [baal] records for the accounts you are trying to enter?

    i want to insert one record pick from[fee insert] table an arrears from [fees] table combine insert into fees table..please advised how i can insert arrear of [fees] into next month.???

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

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. How to get Prior Balance
    By jalals in forum Programming
    Replies: 1
    Last Post: 04-23-2013, 07:37 AM
  3. Help with end balance storing
    By Hulk in forum Database Design
    Replies: 6
    Last Post: 03-24-2011, 04:21 AM
  4. I want MSN appear when I am out of balance
    By miziri in forum Programming
    Replies: 4
    Last Post: 06-20-2010, 02:53 AM
  5. Condiation in balance not less than zero
    By miziri in forum Programming
    Replies: 0
    Last Post: 05-24-2010, 08:21 AM

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