Queries :: Maintaining Proficiency - Expiry Of Count
May 25, 2014
I have a table for logging experience for employees related to a given requirement.
The requirement is that any employee, to maintain proficiency ("be current") , must maintain an event count of minimum 5 within last 3 months. Or else the employee is not current and other measures must be taken.
I want to know when the currency expires for each employee (= at which date does the employee no longer have a count of minimum 5 within last 3 months).
So with the data below
tblProficiency
--------------
ProfID (PK, autonumber)
ReqID (FK)
EmpID (FK)
Completed (Date)
EvenCount (integer)
Code:
ProfID EmpID ReqID CompletedDT EventCount
10 2 1 10/04/2014 4
11 2 1 11/04/2014 3
12 2 1 12/05/2014 2
13 2 1 13/05/2014 5
14 2 1 14/05/2014 3
15 2 1 15/05/2014 2
16 2 1 16/05/2014 1
17 3 1 17/05/2014 3
18 3 1 18/05/2014 4
19 3 1 19/05/2014 3
20 3 1 20/05/2014 1
The result should be:
EmpID Expires
2 14/08/2014
3 18/08/2014
I need a hint for some SQL to do this.
View Replies
ADVERTISEMENT
Apr 23, 2013
What I am trying to do is create a stock database and iv imported a blank version of the northwind template and filled it in with my own products which is fine up to a point.
What i also have though is i get weekly reports of the stock of each product with their batch numbers, expiry date and quantity remaining for that individual lot sent to me from another company. (So i might have several lines with the same batch number and expiry date but diffeent quantities) So what i want to ask is:
Is there any way for me to combine the data in the weekly reports with the stock level data in the northwind template?
What i want to be able to have is where somehow i can see the total quantity of eac product with the same batch number and expiry date and then it tells me when that batch has expired and it also automatically deducts the stock from my total stock when it gets to within e.g 9 months of the expiry date as we will not likely sell those.
I need to do this as at the moment all i can get from my database is how much stock has been ordered, sold and what we have in total on hand but if the stock is close to expiring then i wouldnt know and i need to be able to see when to order stock in advance as i want a minimum of 6 months cover and ideally 9 months cover as orders for stock dont come in straight away.
Also, how i can import the data from the weekly reports into excel/access easily as they come as word files presented as a table but the data is put in frames i think and iv tried removing them but then it all looks messed up.
View 1 Replies
View Related
Aug 7, 2015
I have a query which shows data about certain checks that are carried out employees. One of the fields is Expiry Date of the check. What I want is for the query to show only records that have a expiry date which has expired or is going to expire within the next three months of today's date. But I cannot work out how to do it!
View 2 Replies
View Related
Mar 5, 2014
I have a query call courses and field name expiry date I have add additional field within the query to show how many day left and how many days over the expiry date
Code : DayLeft:[expirydate]-now()
but i just get a error when i run the query
I also would like to ask is this possible to be done within the table e.g adding another field dayleft and some how add formula to calculate number days left or over due .
View 2 Replies
View Related
Nov 17, 2014
I have a task completion database. Each record of model consists of an expiry date. I need to review and update the records before the expiry date. Each model may have more than one record as I have updated the models a couple of times. I would like to select all of records with the expiry date less than 30 days so I can plan to review and update them on time. How to select all these records.
View 2 Replies
View Related
Apr 13, 2014
I am looking for a data model to define and track proficiency/currency.
Example:
You earn a licence to do X. You need to renew your licence every 2 years or so. But also, to maintain currency, you need to do what the licence gives you the right to do often enough, or else you need to do a test.
Specifically, you need to do X a specified number of times N within, say, last 3 months at any one time to maintain currency. If you have lost your currency, you need to do a test/check. So at all times, you need to have N times on record within last 3 months, or a test.
In addition, to do X legally, you also need to document that you have done X at least 10 hours within, say, last 6 months, or that you have another test within those last 6 months. This is independet of the previous requirement (concerning the number of times you did X).
Both requirements must be fulfilled at all times for you to do X legally.
So, any suitable model out there? Essentially, something capable of defining and tracking currency for various ratings and license privileges of pilots would do just fine.
View 2 Replies
View Related
Aug 28, 2013
I have built a query to calculate the expiry dates of training courses but I am trying to input a criteria so that only dates within 90 days of todays date show. I am using Date()<90 but it doesn't return the correct information. What the criteria should be for this?
View 1 Replies
View Related
Aug 16, 2015
I have a table that has 5M+ accounting line entries. Below is an example of one accounting journal in the table.
BUSN_UNIT_IJRNL_DJRNL_ICNCY_CMONY_A
CB0014/07/20140002888269323AUD16797
CB0014/07/20140002888269323AUD-16797
CB0017/07/20140002888269323AUD16797
CB0017/07/20140002888269323AUD-16797
The journal ID above was an accounting entry, debit $16,797 and credit $-16,797. because it was entered as a reversing journal in the system, the table has captured the Journal ID with 2 dates. For my purpose i only want the one date (MIN) date, the total amount of the journal (either the debit or credit amount 16,797) and the total number of lines the journal ID has so in this instance I want the count to be 2 and not 4.
Right now this is what i get
BUSN_UNIT_I JRNL_I CNCY_C SumOfMONY_A CountOfJRNL_I MinOfJRNL_D
CB001 0002888269 AUD 0 4 4/07/2014
This is the output i would like
BUSN_UNIT_I JRNL_I CNCY_C SumofMONY_A CountofJRNL_I MinOfJRNL_D
CB0010002888269323 AUD16797 2 4/07/2014
Im thinking with the total sum because theres debits and credits is there a way to do the absolute value of the journal MONY_A then divide by 2?
current SQL
SELECT [One Year Data Lines].JRNL_I, [One Year Data Lines].CNCY_C, Count([One Year Data Lines].JRNL_I) AS CountOfJRNL_I, Min([One Year Data Lines].JRNL_D) AS MinOfJRNL_D, [One Year Data Lines].BUSN_UNIT_I, Sum([One Year Data Lines].MONY_A) AS SumOfMONY_A
FROM [One Year Data Lines]
GROUP BY [One Year Data Lines].JRNL_I, [One Year Data Lines].CNCY_C, [One Year Data Lines].BUSN_UNIT_I
HAVING ((([One Year Data Lines].JRNL_I)="0002888269") AND (([One Year Data Lines].CNCY_C)="aud"));
View 9 Replies
View Related
Dec 6, 2006
I've set up a database for product tracking. It is going to be used by several users at one time. I'm going to implement it in stages as inevitably there is going to be some fine tuning to be done etc. I have a few questions with regards to editing.
1, I presume that I cant alter the database while it is being accessed by others?
2, Is it better to alter another copy of the database and the import the data being generated and then copy it to back the server in one go?
3, If so how do i do this as I’ve had a trial go and failed miserably?
4, Is there another way of doing this minimising the down time of the database?
Being relatively new to access your help would be gratefully appreciated.
cheers
EQ
View 1 Replies
View Related
Dec 8, 2007
I am creating a database for a company that sells a product with a variety of options.
They have all their previous orders in a works spreadsheet file. Each customer has their own file with every order for the past 15 years. There are probably about 1.5 million records.
The company wants all those 1.5 million records accessible in their access database.
I've brought in about 20 records for the history and they can run a query to see a customer's past orders by their account number.
My question: Should I put all the history into one gigantic table or would it be best to try and create separate tables for the history? (Maybe history by state.)
The history table then will take the new orders each year and add to that table.
(Eventually, once the database gets done I'm thinking we'll have to step up to SQL but not sure.)
Thanks for any advice.
Melanie
View 7 Replies
View Related
Nov 17, 2014
I have an issue using the Simple Query Wizard in Access.
I am attempting to Group by the field 'HouseName' and to group by the Max 'Area'. However I also want to retrieve from the query the County which is associated with this.
I have included a sample table below. I wish for my output table to be as follows;
HouseName: County: Area:
Park 1 A 100
Park 2 C 78
Park 3 A 70
(Where Park 1 is HouseName attribute, A is County attribute and 100 is Area attribute)
Sample Input Table:
HouseName: County: Area:
Park 1 A 100
Park 1 B 60
Park 1 A 85
Park 2 C 78
Park 2 D 34
Park 3 A 70
In SQL View my query looks like this;
SELECT TableExample.[HouseName], Max(TableExample.Area) AS MaxOfArea
FROM TableExample
GROUP BY Table.[HouseName];
How to link the associated County to the output.
View 1 Replies
View Related
Apr 5, 2006
i inherited a database created i believe in access 2000
everytime i need to update a report or what not i must find a machine runnning 2000
how do i go about working on this database with access 2003
Thank you
View 3 Replies
View Related
Jul 17, 2006
I have a form with a "WorkerID" field. Once the worker enters his ID once, I want the same ID to show up for all the subsequent records so that he doesn't have to type it over and over again. Is there any way to do this? Sorry if I sound totally new to this (I am)!
View 1 Replies
View Related
Aug 3, 2006
How do I maintain referential integrity between a main form and a subform, each based upon different (but joined with integrity enforced) table?
Here's the situation:
I have two tables: tblContracts and tblPayments. tblContracts has an autonumber field called IDKey as its primary key. tblPayments also has an IDKey field (Integer datatype). The two tables are linked in a one-to-many relationship on the field IDKey with referential integrity enforced.
I have a main form based upon tblContracts (the "one" side of the relationship) that has an embedded subform based upon tblPayments. the two forms are linked Parent/Child on the IDKey field.
Here's the problem: If a user goes to a new record in the main form, it allows them to enter information in the subform without entering information in the main form. This means that a new record (and its corresponding autonumber IDKey field value) does not get generated in tblContracts and I have an orphan record in tblPayments that is not linked to any record in tblContracts - which violates the referential integrity that is supposedly enforced between the two tables.
Any guidance on how to deal with this would be greatly appreciated.
TIA,
Carolyn
View 5 Replies
View Related
Dec 3, 2012
I have an application that is used by individual teachers to generate reports for central admin. It is not secured except I have locked out access to all objects, Navigation pane is hidden, etc to protect the integrity of the tool. I must also maintain this as changes are propagated. I am trying to find a way to upgrade forms, functions, queries, etc without manually having to unlock and relock every db for each school site when changes are required. I have tried importing and exporting from a master db, turning objects on and off by recognizing my password, splitting code and data (db's are on flash drives and path changes every time they are inserted, many teachers cannot handle refreshing table links), I have tried writing code to import the changes at next startup, etc. It is written on Access 2003.
View 3 Replies
View Related
May 19, 2012
I need to create buyer and seller invoices within my access 2003 databases, my sister in law runs an antiques auction house and I'm working on a database to capture all their information.
I've created a 2 queries (a buyer invoice and seller invoice), show all unsettled items with the relevant item information and fee's.
However, I would like it to automatically allocate an invoice number, and store the information back to a table (seller and buyer ID, total number of items on the invoice, total fee etc)
I'd like store the invoices as well, so within the customer record form, I can include a box showing a list of the buyer invoices on one side and seller invoices in another (not all customers are buyers and sellers).
Once I've issued an invoice, can I automate it to show that item as then as invoiced?
Can the invoices be editable at all?
When they come in and settle their account, I also need to feed this information back in as well.
Can i arrange an invoice for seller's particularly, to show all sold items, and the fee's associated with them
Returned items as well as any associated fee's with them?
I have been looking at the Northwind example.
I see how they have an orders details table and orders table, I could replicate this.
I could have an Buyers Invoice table and Buyers Invoice Details table, but how do I generate an invoice, pull the next Invoice number from my (currently blank) invoice table, and pull in the outstanding items for that buyer for that specific auction date (I have a query), and then populate back information from the invoice?
I like the fact that their order form is editable, do any changes go back to the query, that then populate the invoice when you click print invoice?
I need to be able to (at the end of the auction) pull all items from my item log, for that buyer, and print them an invoice, automatically saving all the invoice details back into my database.
I need be able to automatically flag the items in my items table, as invoiced and pull the invoice number in?
I can see how all the Northwind tables, queries, and forms relate to each other and subforms, but I'm not sure how to actually create an invoice, get invoice number, merge with my query, and then feedback in.
View 1 Replies
View Related
Mar 28, 2015
I am trying to make a basic database system to track orders and contacts and the like for my small business. I have created a series of databases that look pretty standard, something like this example:
I want to create a form that I will open and complete every time I process an order. I want to fill out both the customer info and the order details at one time.
Assuming that the "CustomerID" in the "Customers" table is set to Autonumber in order to create a unique ID, how do I keep from creating multiple new "customers" every time I enter a new order regardless of whether or not that customer already has an ID number from a prior order?
It seems that I would need to make some sort of Macro that would say something like, if the "CompanyName" entered is already listed in the 'Customer' table, use the existing CustomerID, if it is not listed in the Customer table create a new CustomerID.
Should I be looking into Macros, and if so should the macro be built into the form or the database?
View 1 Replies
View Related
Sep 26, 2006
Hi I am doing a date expiry query which has worked for one of my other queries i have copied the same criteria for another table but for some reason it does not work now
Below is the SQL i am using
SELECT Computers.[Machine ID], Computers.[Machine Type], Computers.User, Computers.Department, Computers.[Installed Applications], Computers.[Serial Tag], Computers.[OS Installed], Computers.[Pc Brought]
FROM Computers
WHERE (((Computers.[Pc Brought]) Between DateAdd("d",30,Date()) And DateAdd("d",-30,Date())));
I have 3 records which are within the criteria but for some reason i do not get these.
Any idea why this does not work but works for my other query
Many thanks
View 2 Replies
View Related
Mar 4, 2013
I've been using MS Access 2007 for years to manage some Excel data. running some queries etc. Just recently I've been encountering problems when importing data into an existing table. When I do it now, I get a "Subscript out of Range" error. To troubleshoot, I imported into a new table and when doing so, the fields no longer match the column order of the spreadsheet. They all get imported but appears in a different order. I think this is why I am getting the error message. How can I go about ensuring that the data gets imported properly into my already existing table? My fields in "Design View" will match the order of the Columns in the Excel spreadsheet.
View 2 Replies
View Related
May 25, 2005
I have a issue date and an expiry date feilds,
the below script in my query is to automatically increase the date by one year, this works fine but i would like to be able to back date the script if necassary.
i have checked the properties and the field is not locked. but it wont let me change the date.
any ideas
Expirydate: DateAdd("m",12,[Issueddate])
View 4 Replies
View Related
Jan 23, 2006
Hello, im new to this forum, and i need some help fast.
I have a database which is a list of all of member with some information and an expiry date for there membership. What i would like to be able to do is run a query and for it to search a table and give me the names of the people whos member ship has run out or is going ot run out within a month of the query being run.
I have tried several things already but access isn't realy my thing, i do Visual basic .net .
If any one has any ideas about how i could sort this would you please be able to respond, thanks in advance!
View 5 Replies
View Related
Oct 24, 2011
We work in 7 states I want to build a skills database so i can search for particular skills, sometimes excluding people based on home state for travel reasons..
I am editing a free student template..
View 4 Replies
View Related
Dec 9, 2013
Can a Form/Query warn when a date is approaching; like in a pop up or any other behaviour?
View 7 Replies
View Related
Nov 18, 2013
i need a method to store an expiry date. i have a column prepared in my table but i do not know how to reach the desired result.
the date will always be different depending on certain criteria
the course length. some courses we have are valid for a month. some for 6 months. some for a year and some for only 14 days.
i can use the date add to add the date period to the purchase date but i do not know where or how to store course length to be able to use it.
i have approached this before and i had a column in my courses table as below
("m",3,Date())
i pland on haveing this type for each course and varying it as applicable but this did not work and apparantley i was breaching the fundamental rules of relational data.
View 8 Replies
View Related
Nov 20, 2005
Basically, i have a field where the expiry date of a credit card is input, but i want to set an input mask so that it loks something like this:
MM/YY but i cant find a way of doing this!
I then have validation text which makes sure that this value is either equal to or more than todays date! this looks like this:
>=int(now())
So the input mask has to accept this validation...
If you could help, i would be very greatful!
Cheers
View 1 Replies
View Related
Jul 12, 2013
I want to have an input mask on an 'Expiry Data' Field so that the input method is 'MON-YY" and I need access to realise it as a data. And then I also need when a user opens a record an anything that is 2 weeks from expiring I need an error message to pop up.
View 1 Replies
View Related