English 中文(简体)
Creating an MS Access query based on system, status, and date
原标题:

I am just learning Access and have been tasked with creating a database for system access. We need a report that shows what systems have been in a pending status for 0-30 days, 31-60 days, 61-90 days, and 91+ days. I am soooo close to getting this but I’m at a dead end. For the examples below I will just use NFC and eOPF as the systems (there are five systems in all).

So the report would read like this:

Pending Date...0-30...31-60...61-90...90+
NFC....................1.........4..........8........1
eOPF..................2.........5..........1........0

I have the table setup with a status field for each group (i.e. NFC Status = “Pending” or “Complete”)

I have another field that has a date submitted (i.e. NFC Submitted Date = “XX/XX/XXXX”)

This is what I have done. I am only sharing this to give an idea of the direction I was heading. If there is a better way please let me know.

I created two quires (NFC Requests & eOPF Requests)

The first row field in the query is the status (i.e. NFC Status) with Criteria =”Pending”

The second row is the 0-30 days with the field of NFC 0 - 30 Days: Sum((IIf([Systems Access - Table]![NFC Form Date Submitted]>Date()-31,1,0)))

The third row is NFC 31 - 60 Days: Sum((IIf([Systems Access - Table]![NFC Form Date Submitted]Date()-61,1,0)))

Etc, etc.

So I have two quires that give me that data I need and they work. Now, I need to figure out a way to combine the quires by changing the fields that calculate NFC and eOPF separately and calculate them together.

I tried to build a summary request report but it wants to push the totals for eOPF over and I can’t line them up.

It looks like this:

Pending Date...0-30...31-60...61-90...90+...0-30...31-60...61-90...90+
NFC....................1.........4...........8........1
eOPF..............................................................2.........5.........1.........0

I’m getting frustrated and could really use some help.

  • Justin
最佳回答

I think what you are looking for is a "crosstab" query google a nit and you ll find many good examples for ms access.

This is one that helped me alot.

http://www.paragoncorporation.com/ArticleDetail.aspx?ArticleID=25

问题回答

暂无回答




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

access query to filter and combine count

i have two access tables tableA num count 1 7 2 8 3 9 4 9 5 13 6 6 tableB num count 0 1 1 14 2 12 3 5 4 5 5 11 6 5 how can i create an access query that ...

How to show File Picker dialog in Access 2007?

I want to show a dialog where the user can pick a file, click OK, and then the path to the file will be saved in the database. I have just one problem, I can t figure out how tho show the dialog ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

Returning row number on MS Access

I have 4 tables, from which i select data with help of joins in select query...I want a serial no.(row number) per record as they are fetched. first fetched record should be 1, next 2 and so on... In ...

热门标签