Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    OK - so anwser this question



    in which case is there any importance as to which record is which counter - at the moment there is no means to telling them apart except the ID?

  2. #17
    Sana Firdaus is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    22
    We have a name text field to differentiate which record is which counter.I have attached the Database for it.
    Attached Files Attached Files

  3. #18
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    same db as before - no name field.

    And to be clear - there are no name duplicates, at least not within same dept, sub dept and date. Otherwise you will have the same problem, just at a lower level

    One other thought, your date field - do you have a time element as well, could use that instead

  4. #19
    Sana Firdaus is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    22
    Check the 17 reply,i have attached it

  5. #20
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    this should work

    SELECT (SELECT Count(*) FROM Table1 C WHERE Department =T.Department AND [Sub Department Rank]= T.[Sub Department Rank] AND clng([Start Date]) & [Name]<=clng(T.[Start Date]) & t.[name]) AS [Counter], *
    FROM Table1 AS T;

    could be quite slow because of combining text.

    Unable to test because the db seems to be corrupt, unable to edit the query


    If order within the date doesn't matter then you could use the ID which should be quicker

    ....AND [Start Date]+[ID]/100000<=T.[Start Date] +T.[ID]/100000

    what you are doing is extending the date to include another sub value - in the name example converting the date to a number and appending text so you get

    1/1/2016 is stored as a number (42370) to which you append the text so you get

    42370OWK-0010001: Q CSV Support for R&D Symyx ELN 6.9 Upgrade

    to compare with the other values

    using the ID route you would have (11 for the ID)

    42370.00011

    and being numbers the comparison being undertaken should be quicker

  6. #21
    Sana Firdaus is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    22
    Thanx for your time&help.its working with the name using as distinct ID for Dup date values.
    Even though,its query is a bit slower but thank god its resolved.
    Thank you very much once again Ajax :-)

  7. #22
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    no problem

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 08-14-2015, 03:06 AM
  2. Replies: 9
    Last Post: 08-11-2014, 01:24 AM
  3. Adding an autoincrement field to a query.
    By Javier Hernández in forum Queries
    Replies: 4
    Last Post: 05-14-2014, 09:50 AM
  4. Replies: 3
    Last Post: 11-23-2013, 05:05 PM
  5. Replies: 1
    Last Post: 05-22-2012, 10:46 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