Results 1 to 2 of 2
  1. #1
    Sremm is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Jun 2019
    Posts
    1

    Please Help me with a basic SAS Data step alternative in Access

    Hello,

    Awhile ago I inherited a handful of VB6 programs that produce financial reports.

    These Access databases have a form with some controls like date and check boxes for the reports to generate.

    I had added some new accounts in the past and I did part of the work SAS a few years ago...

    I have this basic data step that takes my table and creates a new Member ID column and populates the field with a 1 for the first member and adds a +1 to the others if its not the first member in the group by. My data set has many accounts and members so the auto populate feature in Access with auto populate a 1,2,3,4 for 150 rows but I need it to stop and start assigning a 1,2,3,4 for each account or CLIENT_GRP_NAME.

    I spent some time trying to build an Expression in Access that would do the same but it was more of a Challenge than converting my data step into Access as I thought.

    Thanks in advance!

    Steve
    CT

    SAS FIRST DATA STEP WORKS:

    data CW_FINISHED;
    SET CW_FINISHED;
    'MEMBER ID'N +1;
    BY CLIENT_GRP_NAME;


    IF FIRST.CLIENT_GRP_NAME THEN 'MEMBER ID'N = 1;
    RUN,


    NEED AN ACCESS SQL LIKE:
    GROUP BY
    ,
    ,
    ,
    ,
    ,
    HAVING
    ([CW_FINISHED])=IIF((FIRST[CW_FINISHED]![MEMBER ID], [CW_FINISHED]![MEMBER ID] = 1, [CW_FINISHED]![MEMBER ID] = +1]))

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Generating custom unique identifier is a common topic. You want the identifier sequence to be unique for each group. Saving this data to table requires VBA. Calculating dynamically in query can be tricky, simple on a report.

    Review:
    https://www.accessforums.net/showthread.php?t=77176
    http://allenbrowne.com/ranking.html
    https://www.accessforums.net/showthread.php?t=23329
    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. Replies: 22
    Last Post: 07-18-2017, 01:05 AM
  2. Replies: 2
    Last Post: 10-21-2016, 11:26 AM
  3. Northwind Database Tutorial step by step
    By AATQA in forum Access
    Replies: 1
    Last Post: 10-22-2013, 06:20 AM
  4. Replies: 4
    Last Post: 12-16-2010, 05:29 AM
  5. Replies: 4
    Last Post: 04-29-2009, 04:59 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