Results 1 to 7 of 7
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Adding another date code amount

    I am attempting to add in the amount of deferred CRs to a certain board Date (CMB-01, CMB-02.....) The count I already have:



    Click image for larger version. 

Name:	TTLs.png 
Views:	13 
Size:	7.9 KB 
ID:	20812

    Was done with the following code:
    Code:
    SELECT [CMB Dates].CMB, Count([Change Request].CR_NO) AS CR_Count
    FROM [CMB Dates], [Change Request]
    WHERE ((([Change Request].CR_No)<>0) AND (([Change Request].Sub_No)=0) AND (([CMB Dates].Start_Date)<=([Date_Input])) AND (([CMB Dates].Stop_Date)>=([Date_Input]-1)))
    GROUP BY [CMB Dates].CMB;
    I derived the deferred data with this code:

    Code:
    SELECT [Change Request].CR_No, [Change Request].Date_ID AS Identified, [Change Request].Date_Closed AS Closed, IIf(DateDiff("ww",[Date_ID],[Date_Closed])>1,(DateDiff("ww",[Date_ID],[Date_Closed]))-1,0) AS [Times Deferred]
    FROM [Change Request]
    WHERE ((([Change Request].Sub_No)=0))
    GROUP BY [Change Request].CR_No, [Change Request].Date_ID, [Change Request].Date_Closed
    HAVING ((([Change Request].CR_No)<>0) AND ((IIf(DateDiff("ww",[Date_ID],[Date_Closed])>1,(DateDiff("ww",[Date_ID],[Date_Closed]))-1,0))<>0))
    ORDER BY [Change Request].CR_No;
    Achieving the data in the times deferred.

    Click image for larger version. 

Name:	Amnt deferred.png 
Views:	13 
Size:	33.6 KB 
ID:	20810

    What I wanted to do was to sum the [times deferred] grouped into CMB Dates Table Start_Date and Stop_Date range and not by individual CR.

    CMB Dates Table

    Click image for larger version. 

Name:	CMB Dates.png 
Views:	13 
Size:	15.3 KB 
ID:	20811

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If you don't want to group by CR then remove that field from the query.
    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.

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thanks June7, Thats easy. What I wanted to do was to add up all the deferred inside the CMB Date range. between [CMB Dates].Start_Date] and [CMB Dates].[Stop_Date]

    Some of the CRs would fall into several CMB ranges. If Times deferred = 4 then it most likely fell into 5 CMBs (or 5 weeks back from the date it was closed) CR43 would be in 3 CMBs

    This one is a pretty convoluted code I think.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Sorry, don't understand that.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  5. #5
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    June7 See attached.
    15.2 Combined_Backup.zip

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I don't understand this data. What is it for? What is a 'board' date? What is 'deferred'? What is the rule for calculating 'deferred'? What is a CR_No and why is it duplicated in Change Request? Same for Sub_No. How are these values created? What is Date_ID for?

    Why does the db want to run an update action when opening?
    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.

  7. #7
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    This is for a configuration management board.

    Deferred = a Change request that has not been deleyed for additional information. It is not approved to close out or to move forward in the process.
    Deferred calculation is where a CR takes more than 1 week. Thus if it takes 3 weeks it is in deferred status until the final week where it is either approved, withdrawn or denied. When it is closed and it was 4 weeks later than it was deferred for 3 weeks.

    I was using this to calculate: Times Deferred: IIf(DateDiff("ww",[Date_ID],[Date_Closed])>1,(DateDiff("ww",[Date_ID],[Date_Closed]))-1,0)

    CR_No is the main number for a Change Request
    Sub_No is a sub number under CR_No. This is where a change request is submitted with several underlying requirements in the main one. The values are created by manual input by the user. (I didn't see any easier way to do this since it changes the means of tracking numbers upon th eusers whim.)

    It updates the CR_No and Sub_No that equal 0 to keep the ccount correct. All it is doing is changing that Change request date_closed to todays date, and the other by updating the Closed_Date where the vote is Like "Defer*) helping on the deferred count.

    Date_ID is the date where the requirement for the Change Request is identified.

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

Similar Threads

  1. Replies: 12
    Last Post: 07-18-2014, 01:22 PM
  2. Replies: 3
    Last Post: 03-20-2013, 01:31 AM
  3. Replies: 4
    Last Post: 11-10-2011, 03:16 PM
  4. Replies: 5
    Last Post: 06-30-2011, 02:24 AM
  5. Code to spell out check amount?
    By spkoest in forum Access
    Replies: 4
    Last Post: 06-16-2009, 07:44 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