Results 1 to 5 of 5
  1. #1
    accessgr is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    2

    counting dates and inserting them to table field

    i have to tables . relation one to many. i want to count the number of dates
    of the field of one table --- and insert the result to the filed of the other .
    AND USE IIT TO A FORM
    i managed to create the query


    SELECT COMPANY.COMPANY, COMPANY.SOCIALNUMBER, Count(DATESTIRKE.[STRIKEDAY]) AS [CountOfSTRIKEDAY]
    FROM COMPANY LEFT JOIN DATESTIRKE ON COMPANY.SOCIALNUMBER = DATESTIRKE.SNUMBER
    GROUP BY COMPANY.COMPANY, COMPANY.SOCIALNUMBER;


    AND THE QUERY IS WORKING



    BUT...
    WHEN USING IT TO A FORM IT DOESNT DISPLAY CORRECT RESULTS CAUSE ITS NOT INSERTING THE RESULTS TO THE FIELD OF THE TABLE I WANT AND IT THEREFORE DOESNT SAVE - UPADTE ETCH

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738
    Don't store a calculated field in your table.
    Use a query to do the calculation whenever you need it.
    Use the query as the source for the Form.

    To help us understand your environment please post a picture of your tables and relationships.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738
    Now that you have a query that works, why not use the Form wizard and let Access build you a Form. You can always adjust it to customize it.

  4. #4
    accessgr is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    2
    you have chosen fields of which access wizard could not....
    maybe you have chosen fields of a table and of a query based on the same table....

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738
    Can you post a copy of your mdb with the query and some data? But no need for all the data or any confidential info.

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

Similar Threads

  1. DCount only counting some dates
    By Jules48 in forum Programming
    Replies: 7
    Last Post: 09-22-2011, 02:29 AM
  2. Inserting a New Field in Middle of Table
    By AccessGeek in forum Programming
    Replies: 4
    Last Post: 03-14-2011, 09:22 AM
  3. Counting Active Records Between 2 Dates
    By catat in forum Queries
    Replies: 5
    Last Post: 07-28-2010, 10:55 AM
  4. Counting Dates
    By JenBouchard in forum Access
    Replies: 1
    Last Post: 01-22-2010, 05:08 PM
  5. Replies: 4
    Last Post: 08-27-2009, 01: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