Limit The Results To 1 Record Per Job

May 1, 2008

I'm currently trying to create a KPI report (Key Performance Indicator) to log jobs & their response times

I can easily produce a query that gathers all the information needed but I need to find a way to limit the results to 1 record per job as one job can have many records - Primary key being the TaskID field

I need a way to only pick out the oldest record & ignore the rest

For example


A priority 1 job that was logged at 01/05/2008 08:00 that needs to be responded to within 2 hours

Two engineers have carried out the work & logged the following details

1st Engineer responded at 01/05/2008 09:00 and the other returned later to complete the job at 01/05/2008 13:45

I need the query to only pick out the entry for 01/05/2008 09:00 as it's the oldest.


Any suggestions would be most welcome

this is what my query looks like at the moment.

SELECT tblTasks.TaskID, tblTasks.DateReported, DateAdd("h",DLookUp("[ResponceTime]","[tblPriorities]","[tblPriorities]![PrID]=" & [PrID]),[DateReported]) AS DueBY, tblTaskTime.TTStarted AS DateStarted, tblPriorities.Priority, tblPriorities.ResponceTime, [DateStarted]-[DateReported] AS Responded
FROM tblBuildings INNER JOIN (tblContracts INNER JOIN (tblPriorities INNER JOIN (tblTasks INNER JOIN tblTaskTime ON tblTasks.TaskID = tblTaskTime.TTLINKTask) ON tblPriorities.PrID = tblTasks.TaskPriority) ON tblContracts.ContID = tblTasks.ContractNo) ON tblBuildings.ProID = tblTasks.BuildingID
WHERE (((tblPriorities.Priority) Not Like "P8*" And (tblPriorities.Priority) Not Like "P5*" And (tblPriorities.Priority) Not Like "P3*" And (tblPriorities.Priority) Not Like "P6*"))
ORDER BY tblTaskTime.TTStarted;


Thanks

View Replies


ADVERTISEMENT

Limit Number Of Results

Jul 29, 2005

I am designing a database for a marketing company. One of my tables has all of the company's contacts. On the contacts form, I have a button that opens up a query that shows the information for the company that contact works for. I have a problem where if I have more than one contact per company, it will return that many results (which is just a repeated list of the same company information). It is an eyesore to look at the same information in two or more rows, so I was wondering, can I make the query return only one result? I've been looking online, and I haven't found this at all. Thanks a lot.

View 1 Replies View Related

Limit Query Results By Running Sum

Apr 5, 2005

I have an unbound form with a subform which is bound to a query. The subform prioritizes and individually lists all projects my company has on its agenda and the project’s corresponding cost. Is it possible to enter a dollar figure (which would represent our budget) on the main form and have the subform list only the top prioritized projects whose running total costs would fit within the budget figure stated? Any help would be appreciated as I don’t even know if this is possible. Thanks.

View 4 Replies View Related

Limit Query Results To Last 30 Days

Dec 12, 2013

I am querying a linked ODBC table with a date column called "db_created_tms" that has dates in formatted like "2/25/2004 8:54:02 PM" , because it is a linked table I can't edit the data type. How can I limit my query results to the last 30 days.

My query without the date limit currently looks like this:

SELECT QBReportAdminGroup_v_txn_po_line.doc_num_h AS po, QBReportAdminGroup_v_txn_po_line.quantity_qnty AS qty, QBReportAdminGroup_v_lst_item.name AS REFERENCE, QBReportAdminGroup_v_txn_po_line.unit_price_amt AS cost, QBReportAdminGroup_v_lst_vendorODBC.name AS vendor, "" AS LOCATION
FROM (QBReportAdminGroup_v_txn_po_line INNER JOIN QBReportAdminGroup_v_lst_item ON QBReportAdminGroup_v_txn_po_line.item_id = QBReportAdminGroup_v_lst_item.id) INNER JOIN QBReportAdminGroup_v_lst_vendorODBC ON QBReportAdminGroup_v_txn_po_line.vendor_id = QBReportAdminGroup_v_lst_vendorODBC.id;

View 2 Replies View Related

Forms :: Using Form To Limit Results Shown In Query?

Aug 14, 2013

Essentially I have a table for rooms around my school and what the rooms contain. Most of the details for the rooms are Boolean (e.g. If the room has a projector, Yes/No). So what im trying to do is have a form where i can select a checkbox(s) and if i tick one, a query that holds all the room details will only show rooms with projectors in them, which i can then display those results in another form.

My question is how do I get the check boxes in the form to narrow down the room results to only show the ones with the criteria i have selected in the form?

View 1 Replies View Related

Queries :: Limit Query Results To Numeric Value Of Text Field?

Aug 18, 2014

I have a table that has several fields including CallID (autonumber) and SKU (text)

SKU can be anything up to 9 characters, sometimes numeric sometimes alphanumeric. For example: 24300, AA23145, G58d444, 24999, 89332,...

Based on the Count of CallID I can easily get the top20 calls on each SKU. This is the query I use for that:

Code:
SELECT TOP 20 Count(Calls.CallID) AS CountOfCallID, Calls.SKU
FROM Calls
GROUP BY Calls.SKU
HAVING ((Not (Calls.SKU) Is Null))
ORDER BY Count(Calls.CallID) DESC;

The problem is that now I have been asked to create two different lists. One that has the top 20 SKU that range from 24520 and 24599 and another one that does the res tof the SKUs.

Obviously my problem is that the SKU field is text, not numbers so I can't just limit the results in the query by using "Between 24520 and 24500" in the query criteria.

View 7 Replies View Related

Tables :: Limit Combo Box Results Based On Secondary Table

Dec 4, 2013

I have a DB with 4 tables:

Property (used for look-up values)
Service Type (used for look-up values)
Rate Table (uses the Property Table and Service Type Table and is used as a rate look-up table for the daily service table noted below)
Daily Service

Using the Daily Service table, I need to choose a property, choose a service type that is limited to the property (100's of service types, but a property may only have a limited number), and enter a quantity, and have the Rate Table return the specific cost of the service. I didn't think this was too hard in Access (2013), but I seem to be hitting a wall and spending too much time figuring it out. Now I am behind in my project.

I have been trying to do this in a table format, but have been unsuccessful in limiting the results of the Service Type combo box based on the property chosen.

View 2 Replies View Related

Queries :: General Date Field Criteria - Limit Results To Only Specific Month

Apr 16, 2015

I basically have General Date field (e.g. 10/1/2014 6:34:11 PM) and I want to limit the results to only a specific month and only to show reuslts after 6PM. I tried everything and still stuck.

View 2 Replies View Related

Limit Number Of Record Entries

Mar 3, 2006

HeyI'm trying to create a Library database. This involves restricting the number of loans available to each member (currently 3). I need to make it so no more than 3 records exist in that table for each member. For now ive just entered a VB script that has a message box saying not to enter more than 3 loans per person but I dont think thatll be enough, I need some sort of validation for the whole table rather than a field.I know how to limit the returns of sql queries which is all I can find, but not how to limit the actual amount of entries. The loan table is part of a double query within a subform of the member form if it helps :s

View 6 Replies View Related

Import Record 495 Character Length Limit?

May 4, 2005

Hi,
sorry about the unwieldy title: I appear to have reached a limit while adding fields to a fixed width text table which is imported to Access on a monthly basis using Import Conditions to define the field start points and lengths. Using the Import Conditions wizard, I cannot add any break points beyond the 495th character. Is this a known limit, or has anyone found a way around? I've tried both Access '97 and 2002. Any advice greatly appreciated.

Many thanks, Kevin

View 2 Replies View Related

Forms :: Limit Dropdown List To Specific Record

Mar 24, 2015

I have a list of customers. [ID] on (Form1)

I click_on their name [ID] that opens a dialogue (Form2 )specific to them.

I have a table of several dates with the relevant [ID]

I want a dropdown box on Form2 that only shows the dates for that specific customer[ID]

Ive tried [Form2].[ID] in the criteria of the ID field in the query for the dropdown data source.

View 3 Replies View Related

Can Limit A Specific Value From Lookup Field To Only ONE Record At A Time?

Aug 2, 2012

Any way I can set a table up with an intrinsic limit, specifically that only ONE record at a time (this will vary) can possibly have value X selected from a lookup field containing assigned values X, Y and Z. Is this possible? If so, how do I do this?

View 2 Replies View Related

Record Results Problem

Feb 9, 2006

Front End: MS Access
Back End: SQL Server

I currently have a client record database. The most important tables are the client and order tables which are joined via 'clientID'. I have built a search system which displays the results in a subform below the search criteria. The problem is that if a client has more than one order the results show multiple instances of their record...

My plan is to have a 'view selection' button which will then open the form with this selection (minus duplicates).
I was thinking about doing this in one of two ways:

1) Take the client id's from the subform and build them into an IN( insert CSV client ID's here) then open the form with this filter... or
2) Try to remove duplicate records from my result set somehow...

My problem is I have no idea how to do either... I can give example or screenshots if needed. This is the last part of the database and so any help appreciated.

Phil

View 9 Replies View Related

Openform Wizard Results In Blank Record

Oct 19, 2005

Hi All

I'm currently working on a product catalogue, i have a product data screen (frmProductLookup) one of the field s i have is "Replacement" for when a product is superseeded. What i want to achieve is to be able to click on a button and open a second product data screen that automatically goes to the record for the replacement product.

I've currently tried creating a duplicate data form (frmProductLookup2) and used the openform wizard, but for some reason this pulls up a blank record...any ideas

cheers.

View 3 Replies View Related

Modules & VBA :: Goto Record Without Filtering Results

Dec 5, 2013

Is there a way to search for a term within a form and goto a record that matches that term assuming there was only one matching result (Unique ID, for example).

But NOT filter the results so that user can still navigate as usual after the search has been carried out.

View 1 Replies View Related

Forms :: Subform Needs Results For More Than 1 Main Form Record?

Dec 24, 2013

I have two unbound subforms on an unbound "display form". I managed to link the two subforms by following this method: [URL] This is great and works well enough, however, by design, subform2 will only display records relevant to the very first record on subform1. I need subform2 to be filtered based on ALL of the relevant records being displayed in subform1 not just the first one.

Previously, subform2 was based on a query using subform1's records as criteria, but this gave me the same result.

View 14 Replies View Related

Queries :: Updating Column With Various Results Based On Other Record Values

Jul 11, 2013

I have a field called density which needs to be updated to show either 10, 20, 30, 40, 50,60, 70 or 80 depending on a number of variables, for example: If market location is 'hot' and unit type is 'house' and discounted is 'no' then show '10' in the density box.

or perhaps:

If market location is 'cold' and unit type is 'apartment' and discounted is 'no' then show '20' in the density box.

I have tried all sorts of expressions and queries but have really reached the limit of my know how and can't solve it. Is it even possible to do this in Access?

View 2 Replies View Related

Forms :: Selecting Record Results Out Of A List Box In Form - Access 2010

Nov 13, 2013

I am relearning Access and having a little difficulty. I am creating a Access database that links tables from an I series system which I have done trouble free. In the database I have pulled up for example a patient demographic file (hospital). I have form frmSearch that prompts the user to enter the medical record number OR they can search by name. I have a query that takes that information then loads a 2nd form to display the query results in a list box. I would like to be able to click on one of the results from the 2nd form to then load another form that will display all of the patient information that was selected.How do you set this up so that with the results shown, I can click on one of them and it will load that patient into another form pulling the rest of his or her information from the table file?

View 12 Replies View Related

Queries :: Double Click On Results In Order To Go To Original Record Or See More Details

Jun 2, 2015

Is it possible to once you have run a query be able to somehow double click on the results in order to either go to original record or see more details? Similar to "show details" in excel?

I have made some queries that are working well however they are specific in nature and once found display a list of results. I have left a field that uniquely identify them and are after a quick way to view the details of the results from the query rather than take the ID# and manually search the original table.

View 8 Replies View Related

Show Current Record Value From Table In Combobox In Addition To Query Results

May 3, 2015

I have a table, with a related value in another table. E.g. A Items table with a batch value from another table.

I have a form to enter how many of these items has been used and from which batch number they belong.

The batch number is from a dropdown, and batches can be finished(exhausted) and marked such in the table so they no more show in the dropdown.

All this works fine, until, I go back to a entry which was from a batch that has been finished. The combobox is empty although the (Already finished) batch number is mentioned in the table. This is perfectly normal as my query for the combobox is :

Code:

SELECT ItemBatch.ItemId, ItemBatch.ItemBatchNumber, ItemBatch.Finished, ItemBatch.ItemName
FROM ItemBatch
WHERE (((ItemBatch.Finished)=False)
AND ((ItemBatch.ItemName)=[Forms]![ItemMasterForm]![ItemDataSheet].[Form]![ItemName]));

What I want is to show the current batch number as well. I tried to make this query get the current value, but wasn't successful. I tried to make a calculated field based on the dropdown and show its value.

Is there any way I can show the batch number in the datasheet? I have to use a datasheet and not a form, because there will be many sub records for the main form, and having a form will be very uneasy.

View 3 Replies View Related

General :: Randomly Pick Record From Table And Display Results In Two Text Boxes?

Sep 1, 2013

I have one table (500 Club) with two fields (ID) (Name) i would like to randomly pick a record from the table and display the results in two seperate text boxes on a form one for (ID) and one for (Name). I intend to use this for a monthly draw at my workplace.

View 6 Replies View Related

Return Weekend Results On Monday, Yesterday's Results Otherwise

Nov 14, 2007

I am trying to filter a form to show the entire weekend's activity on Monday but only yesterday's activity Tuesday through Friday. Using this code I can return Friday's results on Monday and yesterday's for the rest. How do I get the range Friday to Sunday?

IIf(DatePart("w",Now())=2,Date()-3,Date()-1)

Using >Date()-3 doesn't work.

Thanks

Bruce

View 5 Replies View Related

Reports :: Search Results Report Shows All Database Records / Not Just Search Results

Apr 29, 2014

I have built a custom search form in a MS Access 2010 database so that users can find specific records to edit. After entering the search criteria and hitting a Search button, another form opens up that shows the search results. This second form includes a command button for generating a report of the search results.

Right now, the custom search form and the search results form are both working properly, but the search results report is showing every record in the database instead of just the search results. This is true whether I access the report via the command button in the form or the navigation pane. I'm not sure if I need to correct my VBA code or the report's properties.

View 4 Replies View Related

Limit

Jun 30, 2005

Can you use the LIMIT function in access?

It limits the number of records out putted by a query.

Cheers

View 2 Replies View Related

Input Box And Limit

Jun 29, 2005

I am trying to uses a inputbox. I need it to end the script if cancel is hit, but the value from the input box can be zero? So cant filter it that way.

Also

Does the SQL command LIMIT work in access and is it possible to number row in order?

View 4 Replies View Related

Access 97 & 1 Gig Limit

May 17, 2006

Hello All:

We use a custom built Access “97 version” database at work that keeps track of our internal manufacturing processes. The database stores jpg’s and dwg files that use up a lot of precious DB space and if we had it to do over we would use hyperlinks to these files to save space. But this database we built long ago and we have reached the 1 gig limit of Access 97.

1) If we upgrade to a newer version of access will this increase the database limit to 2 gig’s
2) Is this kind of upgrade easy to do or should this be done by a Access professional

Thanks for the help


Alex

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved