Queries :: Adding New Column In A Table And Populating Values

Mar 2, 2014

I have a table having fields start date and end date. I need to calculate difference in the dates and store the values in a new column in the same table. I am able to write the query for this but am clueless as to how to put in these values in a new column in the table.

View Replies


ADVERTISEMENT

Populating A Column In A Table Based On Values In An Existing Column

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

Queries :: Adding Values To Present Column

Jul 4, 2013

I use the output of a query (qryTally) to set as my values to a table (tblOrderCountDaily) which sets all the count of a product ordered during a cmdbutton was clicked. If cutoff wasnt clicked for that day, it would create a new field setting the field name as the date. Now, if i click again the the cutoff button, it would check again if the field exists, if yes, i would add the value to the previous value.

Code:
Private Sub CutOff_Click()
Dim db As DAO.Database
Dim tbl As DAO.Recordset
Dim strSQL As String
Dim CheckOut As String

[code]...

View 1 Replies View Related

Adding Values Within One Column

Mar 3, 2005

I've been having trouble trying to figure out how i can add the values within one column. I have a field named Cost, under that field i have serveral rows of data. I would like access to add all the numbers under that "cost" field. Im not sure how this is done. Can anyone please help ???

thanks
EM

View 6 Replies View Related

Queries :: How To Distribute Different Values Of One Column In New Column Fields

Jan 30, 2014

In my table for duplicate "line no" I have different "contractor" like below.

LINE NO CONTRACTOR

L-0001 C-1000
L-0001 C-2000
L-0003 C-6000
L-0003 C-8000
L-0003 C-9000
L-0004 C-5000

Now I would like to make a query for transposing values like below:

LINE NO CONTRACTOR1 CONTRACTOR2 CONTRACTOR3

L-0001 C-1000 C-2000
L-0003 C-6000 C-8000 C-9000
L-0004 C-5000

how I have to make this query?

View 1 Replies View Related

Adding Values In Separate Columns Dependent On Text In Another Column?

May 16, 2013

I'm trying to make a database to track inventory or several items. Basically, I have four tables:

1) RawMaterialList - includes a list of all raw materials.
2) PartList - includes a list of all finished product using said raw materials.
3) RawMaterialRecieving - contains details from each packing slip of incoming raw materials.
4) ShipmentRecord - contains details of daily shipments.

Each of these tables is fed by a form of the same name. I should note at this point that I basically taught myself how to use Access and I imagine I'm in the dark about quite a few things it can do. I've made several databases over the last few years, but I'm stumped at this point.

Here's my problem. In the form RawMaterialReceiving, I have several fields aside from basic information:

1) Item - a list of of raw materials from table RawMaterialList
2) Description - also dependent on info entered into table RawMaterialList
3) Quantity

But, I have 12 of these instances.

Item1, Item2...Item12;
Description1, Description2...Description12;
Quantity1, Quantity2...Quantity12.

My problem is I want to add up the quantities of each raw material and I'm not sure how to go about that. Lets say on May 13, I received 15pcs of Part A and 20pcs of Part B. I enter this information as Item1 and Item2 respectively. On May 14, I received 30pcs of Part B. I enter this information under Item1. Now I want to add up all of Part B (50 pcs). But Part B has one value listed in the field Quantity1 and one value listed in the field Quantity2.

Example:

1st Entry:
May 13
Item1 = PartA Description1 = PartA's description Quantity1 = 15
Item2 = PartB Description2 = PartB's description Quantity2 = 20

2nd Entry:
May 14
Item1 = PartB Description1 = PartB's description Quantity1 = 30

How do I get it to add up Part B to get 50pcs?

View 10 Replies View Related

Forms :: Populating Null Field In Form From A Different Column In Same Table

Sep 15, 2013

I've been trying to populate a field in a form with information, but only if the field is blank.

What I am trying to do is this.

I have a continuous form displaying all of our principals, however when our principals are on leave I want to populate the field with the "acting principal". I have set it up so the field grabs the acting principal first but it is blank for several schools. For these schools where there there is no "acting principal" I want it to grab the substantive principal automatically and populate the field.

I have tried Is Null, Is Not Null, NZ, IF, Where and Then statements but to no avail.

View 10 Replies View Related

Queries :: How To Show Row Values As Column Values

Mar 8, 2015

I have a table with following two columns

TechName Version
SQLServer 2000
SQLServer 2003
SQLServer 2005
SQLServer 2008
SQLServer 2008R2
Oracle 11G
MSOffice 2000
MSOffice 2003
MSOffice 2007
MSOffice 2010

How can i show this data as components eqch version for a techname to be one component order need not follow

TechName Component1 Component2 Component3 Component4 Component5
SqlServer 2000 2003 2005 2008 2008R2
Oralce 11G NULL NULL NULL NULL
MSOffice 2000 2003 2007 2010 NULL

View 4 Replies View Related

Adding New Column(s) To A Table

Oct 6, 2013

Assignment : Add two new columns to a copy of the departments table, sec0611_departments. One new column, a text column, will be the name of the manager department. The other new column, a numeric column, is for the annual budget of the department.

As of right now I know how to start the code, which (if not mistaken) should look like;

alter table sec0611_departments
add column ' ______ '
add column ' ______ ';

My question is, what value do I insert in place of "name of the manager" (ex. manager_id, first_name?) and same goes for the numeric column. Price? credit_limit? budget?

View 5 Replies View Related

Queries :: Sum Of Values With Same ID In Column

Aug 14, 2013

I am having some trouble with a program that contains a query that is suppose to sum a bunch of market values that have the same ID and is from the same portfolio.

The problem I had at first was that some of these IDs and portfolios that should have been summed together had one called counterparty that had different values.

So the problem that occured was the following:

ID Portfolio CounterParty SumOfMarketValue
5224 SPAC Counterparty1 -55
5224 SPAC Counterparty2 -45

What I wanted

ID Portfolio SumOfMarketValue
5224 SPAC -100

So what I did was that I deleted that column, but I am guessing that the table somehow might save that they have this difference. How I can make them appear in the same sum?

View 3 Replies View Related

Queries :: Multiplying Two Values From Same Column

Nov 26, 2013

Names Number1 Number2
Name1 1 2
Name1 2 1
Name1 3 -2
Name1 4 2
Name1 5 5
Name2 1 2
Name2 2 5
Name2 3 2
Name2 4 5
Name2 5 -1
...

For each Name, Number1 will always contain the values from 1 to 5. Number2 can vary, however.

I need constructing a query that, for each name, will look at the values in the Number2 column when Number1 is 1 or 2 and multiply them. So, the result I'm looking for is:

Name1 2
Name2 10

(Since 2 = 2 x 1 and 10 = 2 x 5)

I haven't had much look Googling (most search results involve multiplying two columns together, which isn't exactly what I'm after).

View 1 Replies View Related

Queries :: Decision On Column Values In Query

Dec 20, 2013

I have employee attendance in Excel i.e Emplpyee Number, Day1, Day2, Day3....Day31

I have a table in access that have columns Employee Number, Day1, Day2, Day3...Day31, Presents, Annual Leaves etc

Excel file data needs to be transferred in Access table but the number of Presents, Annual Leaves etc needs to be calculated in Access during transfer not in Excel.

Now due to limited knowledge I do not understand how to resolve this issue and how to start. How to calculate the number of Present and Leaves.

View 3 Replies View Related

Forms :: Cascading Combobox - Adding Column To Table?

Aug 4, 2014

I have a form with two cascading comboboxes where the first selection is the alphabet and the second selection is a person's name. (the alphabet is a coding system but not assigned based on a person's name) I used one table based on example 2 of this website: fontstuff. com/access/acctut10.htm

What I want to do is add columns to the table such as organization, purpose, etc. then have them in the form as textboxes that update as soon as the second combo box is selected. Is this possible with just one table or do I need to go a different route?

View 11 Replies View Related

Adding Up Values From Multiple Queries

Jan 30, 2005

Query 1:
Field #1: User Name
Field #2: CountOfUserName

Query 2:
Field #1: User Name
Field #2: CountOfUserName

Query 3:
Field #1: User Name
Field #2: CountOfUserName

Query 4:
Field #1: User Name
Field #2: CountOfUserName

I want to create a Query that will add
[Query 1].[CountOfUserName]+[Query 2].[CountOfUserName]+[Query 3].[CountOfUserName]+[Query 4].[CountOfUserName]=
[My Query].[TotalCountOfUserName]Group by UserName

It seems difficult.

View 6 Replies View Related

Queries :: Turning Column Names Into Field Values?

May 7, 2014

I have a spreadsheet which contains data exported from another system (which I have no control over). I'm using this spreadsheet as a linked table in my database.

The problem I am having is that I can't guarantee that when the spreadsheet is updated, it will contain the same column headings as it did the last time...

The spreadsheet contains a list of temps, with a summary of info off their submitted timesheets. So the column headings (as well as WorkerName, TimesheetDate, etc) may be "Standard Hour", "Overtime Hour", "Over 12 hrs Hour", "Standard Day", "Overtime Day", etc - for each type there will be a Pay Rate and a number of units (hours or days) claimed. The columns only appear if 'someone' in the spreadsheet has claimed something under that heading this week.

What I need to do is to produce a report which gives a summary by person and week of the number of hours claimed and the total charge. I've done that - that part was easy The part I'm struggling with, is how to take the column headings and turn those into descriptors for each charge type... in otherwords, to go from the sample 'timesheet' below to the sample 'ByType' ?

... when I don't know which columns will be present each week?

At the moment I'm using a union query to pull out the info I need, but if the column headings change then I know it will stop working...

sample of my union query... I currently have 8 different sets of bill rate and charge rate, this just does the first couple...

Code:
SELECT qryTimesheetBaseData.[Time Sheet Start Date], qryTimesheetBaseData.[Time Sheet End Date], qryTimesheetBaseData.[Cost Centre], qryTimesheetBaseData.Worker, "Standard" AS RateType, "Hourly" AS RateCategory, qryTimesheetBaseData.[Bill Rate (ST/Hr)] AS Rate, qryTimesheetBaseData.[Time Sheet Billable Hours (ST/Hr)] AS Billable, qryTimesheetBaseData.[Time sheet Status] AS Status

[Code] ....

View 3 Replies View Related

Queries :: Adding Totals For Fields With Same Values

Aug 13, 2015

I've got a table with data that's been imported from Excel. I need to run a query that pulls the same values of field one and adds the values of field 2. For instance:

Field 1; Field 2
Jones; 200
Smith;150
Jones; 300
Smith;100

In this example, I need the sum of field 2 for the records where Jones is the value in field 1.

So the result in this case is that records where Field 1 = Jones, Field 2 = 500.

View 2 Replies View Related

Match The Sum Of Column Values To Another Table

Jun 12, 2015

I am using access 2010. I have "classlevel" table with 2 columns-Class and Value1 .Value1 column has numeric values that i ll input from webpage (webpage to ms access connectivity).I want to sum the values of column "Value1" and i have another table-"Volume" which has 2 columns "VolumeLevel" and "Value2". So i want to match the sum that i calculated from first table-"ClassLevel" with the "value2" column in "Volume" table and get the corresponding "volumelevel" column value from that table and there is a third table that will get this volumelevel value.

There is no common column to join these tables.

Classlevel-

Class Value1
Class 0 3000
Class 1 2000
Class 2 300
Class 3 400
Class 4 500

Volume-

Volumnlevel Value2
Vo 0
V1 5000
V2 10000
V3 30000
....upto V10

View 1 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

Queries :: Separating Values From Single Column Into Two Columns And Counting Them?

Oct 4, 2013

I have a table that has two columns "Nationality" and "Gender". I wanted to run a query that will Group the nationality and then split the gender column into two columns and after that it will count both gender columns for each nationality. When I posted this question in "Reports" section I got the suggestion to use the SELECT COUNT in SQL. It worked but only for nationality. I couldn't get it work for the Gender column. I searched alot and the only thing I got was the SQL function to split data from one column into two but that also didn't serve the purpose (check the link to see why: [URL]) At last, I went on to create a cross tab query. Selected Nationality as Row header, Gender as Column header and Customer ID as calculation point. And there I got the result I needed. The SQL Code looks like this:

Code:
TRANSFORM Count(Register.[Customer ID]) AS [CountOfCustomer ID]
SELECT Register.National, Count(Register.[Customer ID]) AS [Total Of Customer ID]
FROM Register
GROUP BY Register.National
PIVOT Register.P_Gender;

Crosstab query did the trick..

View 1 Replies View Related

Queries :: Adding Values To Cols Based On Criteria

Sep 24, 2014

I am trying to map certifications done by colleagues in my department.There are 4 certifications and I have which I have pulled out from the Certifications tables using individual query for each certification.Now, I want to add "Certification-Name_Certified" col which will have "yes" or "no" values for each certification to the master data of the department personnel as it only have unique records using a query.

View 4 Replies View Related

Queries :: Adding Consecutive Values To Get A Running Total

Oct 23, 2013

I have a quick (hopefully) query about adding up consecutive values to get a running total.

Currently I have the following

ID Value
1 0
2 5
3 2
4 0
5 1
6 30
7 2

etc...

I am looking for a way to get a running total up to the point of a 0 then restarting. e.g.

ID Value Running total
1 0 0
2 5 5
3 2 7
4 0 0
5 1 1
6 30 31
7 2 33

View 12 Replies View Related

General :: Match Sum Of Column Values To Another Table

Jun 12, 2015

I am using access 2010. I have "classlevel" table with 2 columns-Class and Value1 .Value1 column has numeric values that i ll input from webpage (webpage to ms access connectivity).

I want to sum the values of column "Value1" and i have another table-"Volume" which has 2 columns "VolumeLevel" and "Value2". So i want to match the sum that i calculated from first table-"ClassLevel" with the "value2" column in "Volume" table and get the corresponding "volumelevel" column value from that table and there is a third table that will get this volumelevel value.

There is no common column to join these tables.

Classlevel-

Class Value1
Class 0 3000
Class 1 2000
Class 2 300
Class 3 400
Class 4 500

Volume-

Volumnlevel Value2
Vo 0
V1 5000
V2 10000
V3 30000
....upto V10

Answer that i am looking for is V1 as sum=6200 lies between 5000 and 10000 so its V1.

Table 3-

Volume-
V1

View 14 Replies View Related

How To Find Column Having Null Or Values In Table

Sep 10, 2014

I have created by external data from excel, while one of the column values are showing blank.

How can i find the column having null or values in table.

Error : Type Conversion Failure (ImportError table)

Query :

Code:
SELECT * From empdetail
WHERE EmpId =IsNull ("")

From the above query, not getting the result

View 4 Replies View Related

Adding New Records To Table Based On Values In Another Table?

Aug 19, 2015

I'm developing a database for the hospital I work in. One purpose of this is to keep track of patients with temporary invasive devices (there are many types such as urinary catheters, ventilators, etc.), specifically how many days each patient has a device for. Each device is associated with one patient only, but one patient may have many devices. Here's how the associated tables are set up:

1. tblPatients - PatientID (PK), LastName, FirstName, DOB,...
2. tblLocations - LocationID (PK), LocationLabel,....
3. tblDevices - DeviceID (PK), DeviceType, Device, DeviceDesc
4. tblDeviceUse - DeviceUseID (PK), DeviceID (FK), PatientID (FK), LocationID (FK) (where in the hospital was device inserted, e.g., operating room, bedside, etc.), DeviceStartDate, DeviceEndDate
5. tblDeviceDailyLog - DeviceLogID (PK), DeviceUseID (FK), DeviceDate, PatientLocID (FK) (area in the hospital that patient is in)

All primary keys except for PatientID & LocationID are Autonumbers; and the tables are linked appropriately.

Whenever an entry is made into tblDeviceUse, I want there to be new records to be automatically generated in tblDeviceDailyLog for each date between the Start and End Dates. For example, patient A123 had a urinary catheter from 1/1/2000 to 1/10/2000 that was inserted while the patient was in the ICU, but the patient was moved to the Medical Ward on 1/7/2000. So tblDeviceDailyLog should have 10 new records associated with this device, one for each calendar day, with the appropriate location for each day.

View 3 Replies View Related

Adding Up Two Values And Displaying It In The Same Table

Jun 20, 2007

Hi,

Im trying to create a database for a stock control system. I have a slight problem, the stock is in two places. So what i have to do is put in the values of stock in each place and then display the value of those two added up in the table. What is the best way to be able to do this?

View 12 Replies View Related

Forms :: Combo Box With Different Column Values To Create A Table

Jan 17, 2014

Am I correct in thinking the only way to have a combo box with different values in each column is to create a table and then bind the combo box to the column you are referring to if you want it to represent a value from another.

For example if I have a combo box with the words January, February etc can that combo box have a corresponding month number value in a separate column (this combo would be derived from a list) or would I need to create a table holding both the month names and numbers and then bind to the name value for selection but use the month number value?

The reason I ask is I wasn't sure if for every type of list I wanted with multiple column values, I would need to create a table.

View 2 Replies View Related







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