ms-access

Access DSUM Issue

自闭症网瘾萝莉.ら 提交于 2019-12-25 14:47:08
问题 I am trying to use Dsum function in a query field to create subtotals of volume per each channel Exp1: DSUM("[vol_tot]","[TBLNAME]","[CH]") I have the following results: CH Exp1 10 200,000 20 200,000 30 200,000 I was expecting: CH Exp2 10 100,000 20 40,000 30 60,000 I'm trying to attain the same functionality as a SUMIF function in Excel... 回答1: The filter criteria argument is incomplete. Try: DSUM("[vol_tot]","[TBLNAME]","[CH]=" & [CH]) Domain argument functions can perform slowly in query

MS Access use table field as query criteria

 ̄綄美尐妖づ 提交于 2019-12-25 14:28:00
问题 I have a question. Is it possible to use a table as a query criteria to count how many items in another table? I have two tables. Table 1 is the query criteria. Table 2 is a table with many data. I'd like to have a new table or insert into an existing table like the figure below. Count number of items from table 2 with criteria from table 1. I can run the query many times to count the data of different years. So the main problem is how to count the items use another table as criteria. I have

View data from database using textbox

岁酱吖の 提交于 2019-12-25 14:25:49
问题 I have made some format in my access database,but when i try to view in textbox it not view the value using the format that i have set it. I use vb.net as a programming language and ms access as a database Access database : Field Name : sampleID Data Type : AutoNumber Format : "000000" VB.net code : sql = "SELECT * FROM Cleaning" cmd = New OleDbCommand(sql, cnnOLEDB) cnnOLEDB.Open() Dim dr As OleDbDataReader dr = cmd.ExecuteReader() While dr.Read() txtSampleID.Text = dr("sampleID").ToString()

Simple SQL Query in access

ε祈祈猫儿з 提交于 2019-12-25 13:26:23
问题 I need some help with figuring out two queries I am trying out from my textbook. I can't seem to figure them out. Any help would be appreciated! The first query deals with getting casino numbers for the casinos whose cities are the first results of the alphabetical list of said cities. Confusing right? SELECT Location FROM Casino GROUP BY Location ORDER By Location; This is what I have so far. What this will do is put AtlanticCity as the top result, which is what I want. Where i'm confused is

Select optimization in Access

ⅰ亾dé卋堺 提交于 2019-12-25 12:48:53
问题 I'm in serious trouble, I've a huge subtle query that takes huge time to execute. Actually it freezes Access and sometimes I have to kill it the query looks like: SELECT ITEM.*, ERA.*, ORDR.*, ITEM.COnTY1, (SELECT TOP 1 New FROM MAPPING WHERE Old = ITEM.COnTY1) AS NewConTy1, ITEM.COnValue1, (SELECT TOP 1 KBETR FROM GEN_KUMV WHERE KNUMV = ERA.DOCCOND AND KSCHL = (SELECT TOP 1 New FROM MAPPING WHERE Old = ITEM.COnTY1)) AS NewCOnValue1 --... etc: this continues until ConTy40 FROM GEN_ITEMS AS

Get Last Row of Different id then display data that is greater than zero

只愿长相守 提交于 2019-12-25 12:48:16
问题 This is my table... +----+--------+ | id | amount | +----+--------+ | 1 | 100 | | 1 | 50 | | 1 | 0 | | 2 | 500 | | 2 | 100 | | 3 | 300 | | 3 | -2 | | 4 | 400 | | 4 | 200 | +----+--------+ I would like to choose from it each value of id that does not have a nonpositive (i.e. negative or 0 ) value associated with it, and the smallest amount associated with that id . If I use this code... SELECT DISTINCT id, amount FROM table t WHERE amount = (SELECT MIN(amount) FROM table WHERE id= t.id) ...

How to open a specific form by clicking on a specific cell or row?

我的梦境 提交于 2019-12-25 12:45:52
问题 In Microsoft Access I made a form with a textbox and a query. Whatever is written in the textbox will be shown in the query (for example you type customer1 and the query displays all rows that have firstname(this is a column name) customer 1). Now I'm trying to make it so that if you double click (or click) one of those rows(customers) it opens a form that only shows that specific row/customer instead of all customers with name customer1(for example). Also this is my query code : SELECT *

How to open a specific form by clicking on a specific cell or row?

狂风中的少年 提交于 2019-12-25 12:45:02
问题 In Microsoft Access I made a form with a textbox and a query. Whatever is written in the textbox will be shown in the query (for example you type customer1 and the query displays all rows that have firstname(this is a column name) customer 1). Now I'm trying to make it so that if you double click (or click) one of those rows(customers) it opens a form that only shows that specific row/customer instead of all customers with name customer1(for example). Also this is my query code : SELECT *

MS Access - combine non-null column values into a (column name: column value) text string / field

丶灬走出姿态 提交于 2019-12-25 12:33:23
问题 I have an Excel file that's basically a query result to a database server. I linked one sheet of this Excel file as an external table from within a MS Access database. This external "Excel table" has a set of columns representing optional parameters. I want to create one "all_parameters" query result field that represents a semicolon-separated list of all non-null parameters as "parameter name: parameter value" tuples. In this case, "parameter name" is also the name of the column in which the

Access 2007 to Oracle 10g linked table — query with flawed results, but no errors thrown

早过忘川 提交于 2019-12-25 12:19:31
问题 Access 2007 databases querying linked oracle 10g tables are returning flawed result sets when using the WHERE clause to filter-out unwanted records. Oddly, some filtering is happening, but not reliably. I can reliably demonstrate/produce the problem like this: Create a *new* database with Access 2007. Create a second *new* database with Access 2007, and then "save-as" 2000. Create a third *new* database with an older version of Access. Run the following query in each database: SELECT STATUS,