Percentage Based On Adjacent Column
Nov 6, 2005
Here's a sample of the query code for survey I made, for example
Question 1 will be
1) Male or Female?
(radio button answer_id 111) Male
(radio button answer_id 112) Female
etc etc...
My question is how do I set my query to show a graph / percentage value of total unique answer_id's in relation to the question_id.
e.g. Question 1: 66.67% chose 111, 33.3% chose 112
question_idanswer_id
1111
1111
1112
2116
2117
3119
3121
4126
4126
4126
I hope I was clear enough am quite new to Access and I really thought I could do this with pressing a few filter/sort buttons but alas I haven't found a way yet.
View Replies
ADVERTISEMENT
Sep 7, 2006
Hiya-
I have a database with 5000 entries, corresponding to about 10 entries for about 500 people. Each of the entries is dated, and I need to calculate the time intervals between each person's sequential entries in the table.
One way of doing this is to create another column that contains the date of the previous entry. I can then use DateDiff to subtract one date from the other and give me the difference in days.
This approach falls down if I then work with only a subset of the entries - I would have to re-enter the previous entry dates as the time intervals would have changed.
What I really need is a way of subtracting the date from the date in the cell directly above it. Will Access let me do this, or is there a better way?
Many thanks, Jules.
View 3 Replies
View Related
Oct 26, 2006
Does anyone know how to add a column to an existing table that would calculate percentage?
Thank you very much in advance!!!
View 3 Replies
View Related
Apr 12, 2013
I have created a cross tab query that contains a row heading for Entity and Total Cases. I would like to have a percentage of the Case Total for Each Category as well as the count for each category. It works fine for just the counts and here is the sql behind it:
TRANSFORM Count(CASEDATA.CASESTATUS) AS CountOfCASESTATUS
SELECT IUIDCODES.CODEDESCRIPTION, Count(CASEDATA.CASETYPECODE) AS CountOfCASETYPECODE
FROM (CASEDATA INNER JOIN CASESTATUSCODES ON CASEDATA.CASESTATUS = CASESTATUSCODES.CODEID) INNER JOIN IUIDCODES ON CASEDATA.IUID = IUIDCODES.CODEID
WHERE (((CASEDATA.CASETYPECODE)=63) AND ((CASEDATA.FYSTATUS)=6 Or (CASEDATA.FYSTATUS)=7 Or (CASEDATA.FYSTATUS)=8))
GROUP BY IUIDCODES.CODEDESCRIPTION
PIVOT CASESTATUSCODES.CODEDESCRIPTION;
View 2 Replies
View Related
Nov 23, 2013
I am stuck at setting a validation rule for my percentage column. The entries in such column must be less than 20 and greater than 10.
View 9 Replies
View Related
Jun 6, 2013
I have about 20 columns in a query and each row is a customer.
The columns are either pass/fail but are text fields and not a yes/no set up. I want to get the percentage of a pass in the column.
View 9 Replies
View Related
Feb 20, 2015
I have an access form which 1 person updates daily, but the task after that is split between 2 users. I have got most of the form data automated with a combo box from a supporting table.
But I now want to automate a username & date, but based on a % and set of conditions.
(At the moment I go in at the end of the week and manually put those 2 usernames next to the new work thats been logged)
I'll try and explain:
user 1... gets 60% of the work
user 2... gets 40% of the work
At the end of that day, when the form is completed with say 100 new records, I want to then run a query, macro (or anythying else that would do it automatically), to assign those usernames 'user1' to 60 of those 100 records... and 'user2' to 40 of the records. and also give it todays date.
Is this even possible?
View 14 Replies
View Related
Aug 8, 2012
I have a table that has 3 columns: Unique number, Date, and Results
I want the user to enter the unique number and date into the form. Then the "results" column/field will autopopulate a 0 or 1. I want it to populate a 0 85% of the time and a 1 15% of the time. This should be cumulative (meaning not every entry has a 15% chance of being 1). Is this possible?
View 1 Replies
View Related
Mar 5, 2007
Hi all,
In the organisation that I work for employees get paid every 2 weeks on a Saturday. So for this financial year the pay period end dates have been 08/07/2006, 22/07/2006, 05/08/2006 etc
I have a column in an Access table listing various dates. I want the next column to be
populated with the next pay period end date after that date.
So if DATE is 05/07/2006 I want PAY PERIOD END to be 08/07/2006
and if DATE is 09/07/2006 I want PAY PERIOD END to be 22/07/2006 etc
How do I do this?
Kind Regards,
Matthew
View 1 Replies
View Related
Mar 24, 2014
I have created a cross tab to extract pipeline and sales for Q1 2014, Q2 2014, Q3 2014 & Q4 2014... the user can select the quater from a multivalued text box...
Now for the final output, have created another query which pull the above four quarter in each column from the cross tab...now the problem arises when i change the quarter to Q2 2014, Q3 2014, Q4 2014 & Q1 2014..it gives an error "Microsoft office Access database does not recognizes "Query name" as a valid field name or expression".
The error is because the second layer of query does not identifies Q1 2014.
How do i make access change the column automatically when the Q1 changes to Q2...
View 1 Replies
View Related
Nov 30, 2014
I need to input a string into a column named "EventType". The code should first check if the column "Agent Name" contains any strings. If there is none, it will input "IBM Director" into the EventType column.
Once it has looped through the agent names, the code will then loop through the Details column and input into EventTypes based on what is displayed within the string.
These are the codes that I am using to achieve this, however nothing is being input into the EventType column.
Code:
Private Sub Command11_Click()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Final")
[Code] ....
I think the problem lies with the code that checks the agent name. When I removed it, it managed to populate the EventType column based on the details. But I still need to find out how to check the agent name too.
View 4 Replies
View Related
Aug 16, 2013
I have 2 table,
Table1 has fields
docno (text)
title (text)
progress (number)
sample data is like below:
doc-001 test1 90%
doc-002 test2 25%
Table2 has fields
sample data is like below:
id (number)
icon(attachment type)
1 image1
2 image2
Now I would like to make a query when progress of each docno is equal and more than 50% it uses image1 And when progress is less than of 50% it uses image2
Doc-001 test1 90% image1
Doc-002 test2 25% image2
View 2 Replies
View Related
Sep 19, 2012
I have a table with the name of a report, the items on the report, and the number of items on the report. I would like to count the instances of the names of the individual reports that appear on another table and then divide that count by the number of items on the report.
View 1 Replies
View Related
Oct 30, 2006
Is it possible to perform calculations across 2 adjacent rows in SQL?
At the moment, I have a running count that tracks the number of updates that go into our database against a specific JobID.
Is it possible to subtract the running count for a previous update from the current update.
For example, I would like my resulting table to end up looking like this
JobID Time Updates Since Last Update
1 10:10:00 1 1
1 10:30:45 3 2
1 11:15:10 9 6
In this example, the Since Last Updates should be found by
subtracting the Updates at 10:10:00 from the Updates at 10:30:45 giving 2 and the Updates at 10:30:45 from 11:15:10 giving 6. It would continue like this for as many rows of data have the same JobID (which could be several hundred!)
What I would then like to do is use the 'Since Last Update' number to display only those updates that are applicable to a certain Time, perhaps using Select Top in SQL.
Am I approaching this from the right direction, or would it perhaps be better to try to do this using Time, as this will always be unique?
Thanks for looking
W1dge
View 1 Replies
View Related
Jul 23, 2013
I have two unbound text boxes and a search button adjacent each that allows me to search for a user via two methods:
1) Payroll ID
2) Surname
They have the following code:
txtPayrollIDSearch
Code:
Private Sub txtPayrollIDSearch_AfterUpdate()
Dim sWHERE As String
sWHERE = "[PayrollID] = " & Me.txtPayrollIDSearch
sWHERE = "[PayrollID] = '" & Me.txtPayrollIDSearch & "'"
[code]...
Then minor differences between the above and the Surname search.I have two questions:
1) How do I make the search more friendly by allowing it to find partial matches, i.e., a user has a surname of 'Smith' but I want to search for 'Smi'?
2) How can I display further error messages if there aren't any matches?
View 14 Replies
View Related
Jun 26, 2013
I have a table with 3 columns (Col1, Col2, Col3).
I have a record like: Col1=A, Col2=B, Col3=C.
I want to be able to do a sort of DLookup but searching all columns for "C" and returning the name of the coloumn "C" is actually in (Col3).
Is that possible at all?
View 3 Replies
View Related
Apr 8, 2014
I have a form with a subform. The subform is a continuous form with two controls, both textboxes. The value in the second box is looked up in a table, where the column name is the value from the first box.
I tried a lot already, this code seems to work but only for the first value of the continuous form and is not refreshed when I click next record on the parent form:
Code:
Private Sub Form_Load()
'get the value from the first textbox
strLabelName = Me.LabelName.Value
'get the ProductID needed for WHERE clause from parent form
strProductID = Me.Parent.ProductID
'use dlookup
strLabelValue = DLookup(strLabelName, "tblProducts", "[ProductID] = " & strProductID)
'place the returned value in the second textbox
Me.Text5.Value = strLabelValue
End Sub
Is it possible what I want and how may I establish this?
View 4 Replies
View Related
May 14, 2013
Is Access SQL able to do this:I want the value from a particular column, whose name is derived from the value in the field of another column?
Eg.
Col1 Col2 Col3 Col4 Col5
1 ABC 234 Col2 ABC
2 BCD 345 Col3 345
3 CDE 456 Col2 CDE
4 DEF 567 Col2 DEF
5 EFG 678 Col3 678
6 FGH 789 Col2 FGH
As you can see, I want the value in column 5 to be derived from the value in Column 4.Is this possible to be done in SQL.
View 7 Replies
View Related
Aug 9, 2013
I inherited a spreadsheet that uses an Index (Match formulate to return a value. I want to use Access to manage the data going forward. I am just starting to build my tables in Access so I have some flexibility and want to do it right. Here is a sample of the data:
KeyEnroll JanFebMarAprMay
abc1/2013103521
def3/201300789
ghi5/201300008
So if Enroll date starts in Jan I want the 10 amt returned from the Jan column. If the Enroll date starts in March, for that client I want the March amy returned, etc.
results: for client "DEF" the amt returned should be "7" because their enrollment date is 3/2013.
View 4 Replies
View Related
Dec 24, 2011
In MsAccess 2007,I want each row color to change based on a column value in the report.
For example: Select Name,Age,Salary from table 1 -creates 3 rows.
Name Age Salary
A 15 1000
B 25 2000
c 35 3000
if Salary column is less than 1001,row should be in red- Row 1
if Salary column is less than 2001,row should be in green -Row2
if salary is less than 3001, row should be orange-Row3 .
How to do conditional color formatting of the entire row in Msaccess2007 based on a column value of each row.
View 4 Replies
View Related
Nov 4, 2013
I am having a database in access and i want to highlight particular text from nearby column to the next column. For example,
--GCCCAGGCCCAAGAATGTCGCCGT GGAGGACTGTCTGTACATCAACGTGTTCGTGCCACGGCCCAGGCCCAAGAATGTCGCCGTCATGCTGT
GGATCTTCGGGGGTGGCTTCTGACAAGCTATTGTGTTCGAAT ACACTGATT
--CGAATGAACGCTGTCCCTTCCACTGCTGGCAACATGCTCCCAGCCTTCGACAATGGCCCTCAATTCGA
GGACTGGTTT CAACGAATGAACGCTGTCCCTTCCACTGCTGGAACTTCCGACTCCTTGTTGCCTAGAATGTCGCCGTCATGC
The first column text it should take as query and then it should only search the adjacent cell and highlight that. While searching in the internet i came across a code also, But i dont know whether i can use that code or not.
ALTER PROCEDURE [dbo].[Search]
(
@searchTerm nvarchar(100),
@style nvarchar(100) = 'font-weight:bold; background-color:yellow',
@maxLen INT = 100
[code]....
View 4 Replies
View Related
Feb 4, 2008
I will need to create a new column in a query with data based off of two columns currently in my DB.
Current fields are: [TestType] & [TestReason].
New TEMP field will be [TestCombo]
TestType has 4 possible option via drop down.
TestReason has 21 possible options via drop down.
TestCombo will be one of 10 options depending on the data in TestType & TestReason.
examples: (here is an example of how the combo field will be populated. There will be ten total rules like this. one for each possible text option in the combo box.)
If [TestType] is "DRUG" & [TestReason] is "PRE" or "RAND" or "PA" then [TestCombo] would be "DOTDT".
If [TestType] is "ALCOHOL" & [TestReason] is "PRE" or "RAND" or "PA" then [TestCombo] would be "DOTAT".
If [TestType] is "DRUG" & [TestReason] is "N-PRE" or "N-OTHER" or "N-FUP" then [TestCombo] would be "NDDT".
The data does not need to be saved anywhere at all in the database, just generated when pulling this query. It will then be exported and dumped into another system.
Thanks. Here is a temp copy of the database with some junk data to maybe make it a little more clear.
View 9 Replies
View Related
Jun 16, 2014
This seem to be simple for single criteria but i am not able to do it multiple. I want to restrict user to customer list they r able to see in form combo box drop down list.
users are in employee TBL
employee group criteria is in tbl_Groups which contains value Admin,Read Only, manager etc
employee r grouped through tbl_AssignUsersToGroups.
customer r grouped in customerType TBL. i.e class1, class2 etc
created EmployeesClassTypeRestriction TBL to store restrictions for employees
Restrictions criteria:
1-employee can view only specific class which includes all customers in that class
2- employee can view only specif customers in a class only.
3-employee can view only specif customers in a ANY class.
4- No criteria No restrictions and can view all customers in all classes( For Admin )
Tried to used Tempvar criteria in customer combo box qry but it works for above point 1 only.
Attached accdb sample also.
View 5 Replies
View Related
Nov 20, 2014
I have a form, where one field is a combo box
The combo box is two columns linked to at table,
task and sla
You pick the task, and it displays the task
What i need is, another field, to equal the SLA part of that task.
View 5 Replies
View Related
Nov 8, 2013
Is there a way of using a text field value as the heading for query column?
ie change...
Column header: FieldInATable
to
[form1].[field2]: FieldInATable?
View 1 Replies
View Related
Feb 9, 2015
Access 2010. The first table is called Clients.The Primary Key field for the Clients table is an AutoNumber field called ClientID.The other two relevant fields in this table are ClientFirstName and ClientLastName. The second table is called Contacts.In the Contacts table is a foreign key field, bound to the ClientID field from the Clients table, and also named ClientID.
On the Contacts table, the ClientID field properties are set on the Lookup tab as follows:
Display Control: Combo Box
Row Source Type: Table/Query
Row Source: SELECT clients.ClientID, clients.ClientFirstName, clients.ClientLastName
Bound Column: 1
Further, in the Row Source's Query Builder, ClientFirstName and Client LastName both have Ascending selected as Sort criteria.
Everything works as intended: When entering data into the the Contacts table (actually, the data is entered via a form built from the Contacts table) the data entry person can click the drop-down on the combo box for the ClientID field, scroll through ClientID records, and see unique ID numbers sorted by first and last names. And the actual data for the field is stored properly as the unique ClientID number.
When entering ClientID data into the Contacts table (or form), is it possible to enable autofill based on ClientFirstName and ClientLastName, rather than ClientID? For instance, let's say we have a few clients named Joe Smith. It would be great to just start typing "Joe Smith," and have the field autofill the ClientID number for the first client named Joe Smith. The intention is to make data entry a bit quicker.
View 3 Replies
View Related