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 Replies


ADVERTISEMENT

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 2 Replies View Related

Tables :: Converting Excel Table For Lookup Of Values Based On Row And Column Headers

Sep 3, 2014

how data is best structured in Access.I have a table of values (for instance: weight) and I need to be able to look up a weight based on the column header (age) and row header (height).How is this sort of data best structured and accessed in Access?

View 12 Replies View Related

Delete Entire Column From Existing Table

Mar 28, 2006

Please help....
I have combined 2 Tables using a select * query.
I have to do it this way as the data changes.
The issue I have is that in both tables there is a common field called "Amps"
Hence my resultant table has 2 columns, Table1.Amps and Table2.Amps.
Every time this occurs I want to delete Table2 column entirely as I use this table to plot a graph.

In short- I need to know the code to delete a column from an existing Table.

Please help..

Pipes

View 2 Replies View Related

Query Pulling A Column Not Existing In The Table

Nov 6, 2007

Is there a way to specify in the query sql, if column XX exists in a table, pull it, if doesn't exist, create a blank column "XX" ?

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

Counting Distinct Values Of A Column Group By Another Column

Dec 4, 2011

I have this table ("people") and an example of possible rows:

id(key) COL 1 COL2 department country name
1 xx yy KPP USA John
2 zz kk KPP USA John
3 ss ff TLL USA John
4 ww qq PPO Italy Marco
5 jj uu PPO Italy Marco

I have to count the number of distinct DEPARTMENT for each NAME; so, for John should be 2 (KPP and TLL) and for Marco 1 (PPO).

I have tryed in this way:

SELECT
COUNT(DISTINCT department) AS NumberOfDifferentDepartments
FROM people
GROUP BY name;

But Access says me there is a syntax error.

I'm working with MS Access 2002.

View 2 Replies View Related

Queries :: Change In Column Based On Base Query Column

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

Modules & VBA :: Input String In Column Based On Data In Another Column?

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

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 :: 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

Possible To Remove Duplicates From A Query Based On Values In Single Column?

May 14, 2015

I have a query that displays this

Column1 Column 2 Column 3 Column 4
TripTitleA TravelerA N/A N/A
TripTItleB TravelerB N/A N/A
TripTitleC TravelerC TravelerD TravelerE
TripTitleC TravelerD TravelerC TravelerE
TripTItleC TravelerE TravelerC TravelerD
TripTitleD TravelerF N/A N/A

I want to filter Column1 to have no duplicates so it looks like this

Column1 Column 2 Column 3 Column 4
TripTitleA TravelerA N/A N/A
TripTItleB TravelerB N/A N/A
TripTitleC TravelerC TravelerD TravelerE
TripTitleD TravelerF N/A N/A

Is this possible?

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

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

Copy Data From A Column In One Table To A Column Another.

Jul 18, 2007

Please would you be able to advise me how I would copy data from a column in one table to a column another table.

But I need to only use table not a query.

Thank you in advance for your help.

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

Two Fields Populating The Same Column

Aug 8, 2007

I posted a few days ago about how I am using a combo box for selecting/entering a name on a form. Once the name is chosen for 'txtEventLeader' it updates the query so the next record shows that name as an option for selection in the combobox.

What I want to do now is also have a field called 'txtEventFacilitator' which would also update the query and update the combobox (regardless if one is choosing the Event Leader or Event Facilitator). I think I need to make a one column query which puts all of the names in one column, regardless if they were the Event Leader or Event Facilitator.

I hope I asked this correctly.

View 3 Replies View Related

Insert Column Between Existing Columns?

Dec 6, 2014

adding columns in Access2013,I'd like to add a column to an existing datasheet and place it between 2 existing columns,I see where and how to an a new column but don't see where I can insert it where I want it.

View 2 Replies View Related

Modules & VBA :: Column Not Populating From SQL Server

Apr 1, 2014

I am populating Access table using a stored procedure from SQL Server. Here is the code that does the populating.

The problem area is the rst!id (highlighted in red). This is the Identity Column from SQL Server. When Access gets to 32768 it results in a blank in the Access Table. Ive Included the picture.

When I step through the loop and get to that 'id' I can see that the next value is there, by hovering over 'rst!id'. So I know that the value is not NULL but it does not record it in the table.

This continues for the remainder of the load, which is few more thousand rows.

Code:
Do Until rst.EOF
strSQL = "INSERT INTO tblStationPatronageEstimate (pax,transactions,time_band,day_type,entrance, " & _
" from_date,to_date,id,station_entrance_id,number_of_days,average_pax_per_day,
average_tran_per_day,vr_used_name,vr_used,userid, " & _
" time_stamp, completed,comment) " & _

[Code] .....

The results

View 3 Replies View Related

Modules & VBA :: Wildcard Search Of Combobox - Lookup Values In Table Column

Nov 19, 2014

I have a form which has a combobox called Task_Ref which looks up values in a table column.

I would like to be able to set the tickbox value of tickbox called P1 to True if the combobox contains the word "test", each entry on the combobox selection may vary such as:-

Test number 1
Yesterdays Test

As long as the word "Test" appears I would like the above to happen?

I was thinking of something along the lines of:-

If InStr(Task_Ref.Value, "Test") > 0 Then
P1.Value = True
Else
P1.Value = False
End If
End Sub

But this hasn't worked

View 4 Replies View Related

Queries :: Update In Table From Same Table Based On Criteria Column In Same Table

Sep 29, 2013

How can I update (some columns) in a table from the same table based on a Criteria column in the same table.

View 2 Replies View Related

Insert Query Result Into An Existing Column

Jun 24, 2005

Hello again.

I've got a query that takes a part number, strips off the un-needed prefixes and suffixes, and gives me just the meat & potatoes of what I need.

I'd like to insert these results into a particular column in an existing table. Say the column name is Part_Number and the table name is CompletedWork. What would the SQL look like for that? I think this is relatively simple but my SQL skills would never be found in the same sentence as 'good'.

TIA for the help. This forum is an incredible source of information.

-Matt

View 11 Replies View Related

Table Of Orders - Auto Fill A Column Based On Selection In Another

Jan 23, 2013

In my database I have a table of customers and a table of orders (where many customers have more than one order, so the primary keys for each table are customerID and orderID).

In the orders table, the first columns are:

OrderID CustomerID Customer Forename Customer Surname

I need my table to auto fill in the customer forename and surname based on the selection of customerID (the names are saved in the customers table).

I already have a lot of data filled in, so am looking ideally for a way to fill these name columns without having to re-input all the data.

View 2 Replies View Related

Modules & VBA :: Update Column In Table Based On Another Table

Apr 24, 2015

I'm trying to use VBA to update a new column in a table with info I already have in another table.The table I want to update is an inventory details table, it has around 25,000 records. I added a column called "UnitCost", of course the column is empty for all 25,000 records so I would like to fill it easily using DoCmd.RunSQL "UPDATE" feature.

I use that through-out the program however I'm unable to connect the dots for this one.What it needs to do is update "UnitCost" in "InventoryDetails" from "Products" where "InventoryDetails.ProductNumber" = "Products.ProductNumber"

The "Products" table has all the different unit cost, it just need to be placed in the "InventoryDetails" table for every record. Of course product1 needs products1 unit cost and product2 needs products2 unit cost, etc.

View 1 Replies View Related

Modules & VBA :: Check If Values In Column A Of Excel Sheet Also Present In Access Table

Sep 2, 2014

In sheet 1, In column A all the Batch numbers are present. So I want to check if each of these is present in Access table named "tblmain". If its present then display its corresponding Policy number in Column B of attached workbook.

View 1 Replies View Related







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