ms-access

Filtering Database Results to Top n Records for Each Value in a Lookup Column

若如初见. 提交于 2019-12-24 09:04:05
问题 Let's say I have two tables in my database. TABLE:Categories ID|CategoryName 01|CategoryA 02|CategoryB 03|CategoryC and a table that references the Categories and also has a column storing some random number. TABLE:CategoriesAndNumbers CategoryType|Number CategoryA|24 CategoryA|22 CategoryC|105 .....(20,000 records) CategoryB|3 Now, how do I filter out this data? So, I want to know what the 3 smallest numbers are out of each category and delete the rest. The end result would be like this:

Union Query Across Databases

守給你的承諾、 提交于 2019-12-24 08:58:49
问题 I want to run a union query on qry_1 in C:\DB\DB1.mdb and qry_2 in C:\DB\DB2.mdb All examples I have seen only show how to run a Union Query on query's in the same database, how can you do this when the query's are in different databases? EDIT --- Grr, not quite displaying results like I was after. That shows each entry twice. Is there a way to only show the entry one time? For example if qry_1 returns Joe 14, Jack 16, Jimmy 12 and qry_2 returns Joe 22, Jack 48, Jimmy 66 is there a way to SUM

where condition in sql with newly created field

旧街凉风 提交于 2019-12-24 08:57:40
问题 I have the following query, why cant I get my where clause to work? The value does exist in the table. Select B.*, B.[RF attribute1] & "|" & B.[RF attribute2] & "|" & B.[RF attribute3] & "|" & B.[RF attribute4] as new_field FROM [Black$] as B where new_field = "Stack|over||flow" error message is No value given for one or more required paramters Edit, Actual data: +---------------+---------------+---------------+---------------+ | RF attribute1 | RF attribute2 | RF attribute3 | RF attribute4 |

cascading combo box causing empty fields in next record

扶醉桌前 提交于 2019-12-24 08:57:23
问题 I'm having problems with a cascading combo box. Everything works fine with the combo boxes and the values get populated correctly. Private Sub cmbAdjComp_AfterUpdate() Me.cboAdjOff.RowSource = "SELECT AdjusterCompanyOffice.ID, AdjusterCompanyOffice.Address1, AdjusterCompanyOffice.Address2, AdjusterCompanyOffice.Address3, AdjusterCompanyOffice.Address4, AdjusterCompanyOffice.Address5 FROM" & _ " AdjusterCompanyOffice WHERE AdjusterCompanyOffice.AdjCompID = " & Me.cmbAdjComp.Column(1) & _ "

Audit Track a form

 ̄綄美尐妖づ 提交于 2019-12-24 08:56:05
问题 I am setting up a Audit Tracking system for the forms in my database. I am following the example from Susan Harkins Here My code works for my form customers which is based off the customers table. Here is my code: Const cDQ As String = """" Sub AuditTrail(frm As Form, recordid As Control) 'Track changes to data. 'recordid identifies the pk field's corresponding 'control in frm, in order to id record. Dim ctl As Control Dim varBefore As Variant Dim varAfter As Variant Dim strControlName As

Should (Access) recordset.findfirst have performance issues with dates?

允我心安 提交于 2019-12-24 08:50:16
问题 I'm using Access to iterate through a table, finding relevant information and bringing it together in a master table. It loads up both recordsets, starts iterating through rsImport (Local <1000 row table), for each rsImport row, it looks to see if is a row that matches the UniqueRef in rsRecords, which it will then eithe update or add if it doens't exist. F8 stepping through the complete code it actually pauses when it des the rsRecords.findfirst. If I remove the DateofAction part, it speeds

Syntax for Import Into from Different DBs - MS Access

断了今生、忘了曾经 提交于 2019-12-24 08:48:08
问题 I'm trying to do (basically) an automated row copy from one backend to another as the backend is being used but is not fully developed (some tables are done, others not; adding the completed data into the more advanced db at the end of the day). I'd like to know what the syntax is for an SQL statement which: INSERT INTO tblMyBetterTable * IN "C:\\path_to_db\db.accdb" FROM tblMyTable IN "C:\\path_to_in_use_db\in-use-db.accdb" The syntax is not correct but I've searched for a while and can't

Import to Excel from Access table based on parameters

…衆ロ難τιáo~ 提交于 2019-12-24 08:47:10
问题 I am attempting to create a template that will utilize data from an Access table, and allow the user to select the parameters in the Excel file. The amount of records in this table is slowing down the Excel file, and I would like to lessen the amount of data that is imported based on the user selection. The Access table will have three columns: Part Number|Line|Catalog Code I would like to import all three columns, but allow the user to select the records imported based on the catalog code.

Searching database with date

元气小坏坏 提交于 2019-12-24 08:33:34
问题 In my windows form, i have one text box where users enters the date in the format 16/02/2013 to search for all the entries on that particular date. In database i have one column which stores date in this format.16/02/2013 02:47:36 AM. Can somebody advise me with sql query to extract all the entries from database for that particular date and put it on dataset. I am using this but it is not working. public DataSet OrderByDate(string date) { // string connString = "Provider=Microsoft.ACE.OLEDB

Set up a form control that updates when a value in a combo box is selected

别说谁变了你拦得住时间么 提交于 2019-12-24 08:29:21
问题 I have a combo box on an Order Entry Form I designed that allows me to select from a dropdown of Company Names from a table entitled tblCustomers. The row source for this control is: SELECT CustomerID, CompanyName FROM tblCustomers; The bound column is 1 so that I can store the CustomerID in the underlying tblOrders table. My question is: I would like a text box on the form that displays the SalesPerson (which is also in the tblCustomers table) associated with the Customer chosen in the combo