Results 1 to 2 of 2
  1. #1
    Relyuchs is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    1

    Query to flag daily change in order status

    I have a table for Order_History where I import an excel file from our ordering system daily. This Order_History table houses all historical order data for a 6 month period. The fields in this table are: [Order_no], [Status_Code], [Date_Code_Chg] and [Report_Date]. The [Status_Code] field indicates which step in our ordering process that the order is in. [Date_Code_Chg] indicates the date that the order moved from one step to another. [Report_Date] indicates the date that the information was imported into the table.



    I need a query that I will run daily to provide me with the beginning count of orders in each Status_Code, and a count of how many orders in that Status_Code that moved to a different status the next day. The query would need to compare the record for each order on a given day against the record for the same order the previous day and let me know if there has been a change from one day to the next. This needs to be done for every order in the table. Note that even though there will be duplicates in the [Order_no] field, each row of data is individual because the [Report_Date] field is different every day. Hope I’m making sense. Thank you for any help you can give – I’m very limited in writing anything other than simple queries.



  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    beginning count of orders in each Status_Code
    * Should be a straight forward AggregateQuery; groupon by StatusCode, and criteria of date

    count of how many orders in that Status_Code that moved to a different status the next day.
    * create a Duplicates query against current day's record set and prior day's record set. Of course auto finding the 'prior' work day might be the trickiest part of this....

    Very do-able just gotta noodle thru it. 1 query doesn't do it all of course - but you can put the results all together in a Report or on a Form as subobjects...

    Hope this helps.

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

Similar Threads

  1. Status reports
    By stosh59 in forum Database Design
    Replies: 2
    Last Post: 01-07-2011, 01:22 PM
  2. Proper way to handle a flag system
    By trb5016 in forum Access
    Replies: 0
    Last Post: 08-25-2010, 01:20 PM
  3. Flag A Data Block
    By JohnBoy in forum Programming
    Replies: 7
    Last Post: 06-29-2010, 01:18 PM
  4. Records change order
    By accessbeginner in forum Access
    Replies: 1
    Last Post: 03-18-2010, 06:38 PM
  5. Creating a Daily Running Total Query
    By seraph in forum Queries
    Replies: 0
    Last Post: 08-15-2009, 12:11 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