Concatenating Various Values From Multiple Columns

Nov 25, 2005

I am trying to concatenate values from seperate columns. Which is fine, however if there are no values in any of these columns I wish to include a dot (.). I also need to add a dot (.) inbetween values.

So for example

Column1 Column 2 Column 3

B11 Europe

would concatenate as:

B11.Europe.

View Replies


ADVERTISEMENT

Concatenating Multiple Field Values Into One Field Separated By Commas

Nov 18, 2014

I am trying to create a list of values in a field separated by commas. I have done this in a query as follows:

[Field1]&", "&[Field2]&", "&[Field3] and so on.

However, when Field2 is null, the result is two commas between Field1 and Field2, but I only need one. What function can I use to eliminate the extra commas when fields used in the concatenation are null?

View 10 Replies View Related

Queries :: Concatenating Values Into One Record

May 14, 2013

I am trying to concatenate 2 unique values which are parts of 2 identical rows(records) in order to have only 1 row(record) with concatenated field where the values are unique. For illustration here is what I need to achieve :

Initial table:
Fld1 Fld2 Fld3 Fld4
AAA XXX BBB CCC
AAA YYY BBB CCC

Final Table:
Fld1_____Fld2______Fld3__ Fld4
AAA____XXX,YYY___BBB___CCC

View 1 Replies View Related

Forms :: DLookup Show Results Values In Textbox On Its Own Line Multiple Columns

Mar 26, 2014

Access 2010 - I would like to use DLookup to show results values from a table and display in a unbound textbox on a form. the results from each column in the table need to be on seperate lines, a break if you may. Here is the code I have so far.

Code: txtKeywords = DLookup("colKeyword", "tblKEYWORDS", "cboCategory = '" & txtcategories & "'")

In colKeyword Column In tblKEYWORDS table match what i select in cboCategory Combo drop down box and populate txtcategories textbox on form

What I would like to do is show All colKeyword results in textbox [txtcategories] and display each result on its own line!

example

entry1
entry2
entry3
entry4

View 7 Replies View Related

Queries :: Concatenating Values In Related Tables

Aug 4, 2014

I have three tables: Event related on to many with Procedure Procedure relates on a one to one basis with the description of the procedure in a table called ProcedureCodes.

I wish to have a query which outputs three columns:

Event - Prcedure1, Procedure2, etc - Description1, Description2, etc.

I have tried the Allen Browne module [URL] .... This gives me:

Event - Procedure1, Procedure2, etc using the expresion:

Expr1: ConcatRelated("[Procedure Code]","[tbl-procedures]","[tbl-procedures].[Event number]=" & [Event no]) to concatenate the procedures.

But I am struggling to get the final column! I have tried the following:

Expr2: ConcatRelated("[short description]","[tbl-procedure code]","[tbl-procedure code].[ProcedureCode]=""" & [Procedure Code] & """" And "[tbl-procedures].[Event number]=" & [Event no])

But this does not return what I want.

View 14 Replies View Related

Modules & VBA :: Concatenating Data From Multiple Checkboxes

Apr 15, 2015

I have 8 checkboxes. Each checkbox has several e-mail addresses as string. Therefore, each checkbox has a string variable declared. I was wondering what should I do when selecting multiple check boxes. This is my code:

Code:
If Me!chkAGDLLA = True Then
Forms!email.lstName = Null
Forms!email.chkComercial = False
Forms!email.chkOperacional = False
strAGDLLA = "email1, email2, email3, email4"
strMail = strAGDLLA & ", " & strISA & ", " & strMAYA & ", " & strSANGER & "," & strSANSE & ", " & strSede & ", " & strGC & ", " & strCSR
MsgBox strMail
End If

Problem is that if I only select chkAGDLLA, then strMail will be "email1, email2, email3, email4, , , , , , ,"

I do not want all those commas, but how to make this work. I was thinking maybe a SELECT CASE so that strMail will accumulate data based on what's checked, but then there will be a problem of there being no comma between cases.

View 6 Replies View Related

Queries :: Concatenating Multiple Rows In Access 2010

Feb 11, 2015

I have a query that has multiple IDs and different information in numerous fields. For example:

ID Field1 Field2 Field3
1 x
1 m
1 b

I need to find a way to concatenate the data so that it shows the information like this:

ID Field1 Field2 Field3
1 x m b

I'm working in Access 2010.

Yes I know this isn't the best way to set up a database, but I'm trying to make fixes to an already existing database that I can't go back and change the way it is set up. I can only find work arounds to accomplish what I need.

View 2 Replies View Related

Concatenating Values From Unbound Sources And Bound Sources

Jul 6, 2005

I know that it isnt advised to store the concatenated value but in this case, I have a memo field which is the description of a particular system component.

i have Unbound Combo Boxes for descriptive elements such as COLOUR, SIZE, CONNECTIVITY, MAKE.

ALL of these i would to store in a field in my table and called Description and separate them by colons or the actual words which describe the category.

Please Advise

View 1 Replies View Related

Queries :: Consolidate Multiple Columns Into Two Columns

May 14, 2014

I have a MS ACCESS 2010 database with a data table which i am trying to create a query from. I have 6 columns of data( one with an ID Field and 5 Name Fields). Below i have made examples of how it first appears as a simple query and the second will show you what i would like it to look like.

What the simple query looks like: [URL] ...

Second what I want the query to look like: [URL] ....

View 2 Replies View Related

Queries :: Put Multiple Records In Multiple Columns

Jul 31, 2013

I have three tables. Risk, Names and RiskAndNamesJunction table. I have the junction table because I have many to many relation (meaning many people can be connected to one risk and many risks can be connected to one people).

The problem is that If I make a query to show the people related to the risks, if there are many people for one risk then it will put the people in different rows. Meaning that for risk 2 I will have three rows, because there are three people connected to this rows. See the attached file!

What I would like to do is to have a query which (in case there are more than one risk owners) puts the second name in another column, the third name in another column and so on. So I will have only one row per risks.

The attached file is a dummy file, so there are only maximum three names per risk. In the real file the maximum is five names per risk. So I am talking about no more then five extra columns. (So I am talking about a query which would put the first finding in the first extra column, then the second item in the second and so on till five. It there is no third or fourth or fifht item then the columns remain blank).

Unfortunately I have to do this because our mother company works with excel and they are sticking to this format in excel.

See the attached file ....

View 2 Replies View Related

Values In Certain Columns

Nov 14, 2007

In my table i have three columns for data entry. They are Subject 1, Subject 2, Subject 3. I need to be able to produce and query that will bring results up if for example 'english' is in anyone of these columns. I know how to do it for just one but i need it to be able to check all three columns?

Hope this makes sense

Sam

View 1 Replies View Related

Putting Row Values Into Columns

Nov 17, 2006

Hi,

I have been trying to figure this out for a long time. Any tips/helps is much appreciated it.

I have a table with 3 columns(SSN,DeductionType,DeductionAmount). Let say I have 100 employees. There are 3 records per employee, because each have 3 different deductionType(TypeA,TypeB,TypeC).

I want to create a queryTable that will result with 1 record per individual, with TypeA,TypeB,and TypeC as column names and the DeductionAmount as their values. Make sense? Below is an example of what the new table should look like:

SSN--------------TypeA-------TypeB-------TypeC
022-58-5898------ $10.35-----$25------------$14
036-89-5487-------$5----------$45.69---------$47.33
...
..
.

Thank you VERY much!

By the way, if QueryTable is not the method to do this, please let me know how.
Joe

View 4 Replies View Related

How To Put Two Columns' Values Into One List-Box

Nov 14, 2006

Hi All,

I have a list box and I populate it with records from a "Select" query. I am using VBScript to do this. Here are my codes:

gr1_list.RowSource="Select Criteria from CriteriaList WHERE Criteria='" & cvalue & "';"

My "CriteriaList" table has two columns; Criteria and CriteriaDescriptions.

The question is, what if in my list box I want to be able to see both 'Criteria' and 'CriteriaDescription?' How would I code this?

Thank you.

View 4 Replies View Related

Default Values For Columns (Date Related)

Jul 27, 2007

Hi,

I want to make the default value of my column "TimeonOW" to be the difference in months(past 12) from the entered date in "OWStartDate" and the current system date.

For for example
mm/dd/yyyy

CurrentDate - OWStartDate = TimeonOW
07/01/2007 - 05/01/2005 = 26

I played around with the DateDiff function but to no avail.
=DateDiff("d",Now(),[OWStartDate])
=DateDiff("d",Now(),#2004-31-12#) etc


The reason behind this is because I need to count how many people fall into different month span categories, maybe theres a better way?

Thanks in advance.

View 4 Replies View Related

Compare Values Of Columns Within The Same Query Table

Nov 19, 2006

Hi,
I am trying to compare two columns' values within the same QUERY table, but I kept on getting the "Data type mismatch in criteria expression" error. What am I doing wrong?

Here is my Select Query Statement:
SELECT qryDedparmDedetail.EMP_ID, qryDedparmDedetail.[Employer Amt], qryDedparmDedetail.[Employer Actl], qryDedparmDedetail.[Admin Amt], qryDedparmDedetail.[Admin Actl], qryDedparmDedetail.[Employee Actl], qryDedparmDedetail.[Employee Amt], qryDedparmDedetail.FirstOfSTATUS, qryDedparmDedetail.FirstOfAGENCY, qryDedparmDedetail.FirstOfTITLE, qryDedparmDedetail.FirstOfFORMAT_NM, qryDedparmDedetail.RepUnit, qryDedparmDedetail.FirstOfDEDTYPE_CD1 AS Expr1, qryDedparmDedetail.SumOfNBR, RepUnit.REPUNITDESC, qryDedparmDedetail.LeftType
FROM qryDedparmDedetail LEFT JOIN RepUnit ON qryDedparmDedetail.RepUnit = RepUnit.REPUNIT
WHERE (((qryDedparmDedetail.[Employer Amt])<>"Employer Actl") AND ((qryDedparmDedetail.LeftType)="01"));

View 2 Replies View Related

Modules & VBA :: Compare Values Of Several Columns Of A Record

Jan 23, 2014

I would like to compare the values of several columns in the same record and remove any duplicates. So...

ID | Col1 | Col2 | Col3 | Col4 | Col5
-------------------------------------------
1 | A | B | C | D | C
2 | C | C | C | D | D
3 | A | A | B | A | D

In the above example I would remove one of the Cs in row 1.

Two Cs and one D in row 2 and two As in row 3.

At the moment I have the value of each column stored in a variable and each one is compared against each other using LOTS of If statements.

View 5 Replies View Related

Tables :: Can Split A Column Values Into 2 Columns

Jul 3, 2014

I have a column that's called "Date" which stores values for begining to end date as 'Text' like: 070314-073114 So I need to split it to 2 columns that has the Start Date as 070314 and End Date as 073114?

This database is still in Microsoft Access, and eventually after cleaning it up, we will move it to SQL Server.

View 14 Replies View Related

General :: Database That Searches Values Between Two Columns

Jun 26, 2012

I'm new to Access programming. I want to setup an Archiving/Storage Database which contains data of boxes with folders in it. The data would be the box number, begining folder, ending folder and box description (See Below).

[BoxNum] [FromRange] [ToRange] [BoxInfo]
123456 10000 10100 Case File
123457 10101 10954 Batch File
123458 11234 11545 Case File

I would like to setup a database that once the data is entered a user can open a form and search for a folder like 10054 by entering it in to a field like [SearchBox] and search the values between [FromRange] and [ToRange] and retrieve that boxes information 123456.

View 7 Replies View Related

Queries :: Combining Columns And Replacing Certain Values

Sep 29, 2014

I need to create a query that combines two columns (lets say Column A and Column B for example) however the problem is that whatever non-null values that are in Column B must replace any value in Column A. If Column B has a value that is null then Column A's value is shown.

I have an example of what I'm working with (access file) and what result I want (excel file).

View 2 Replies View Related

Bound Columns In Forms And Resetting Values?

Jan 19, 2013

I have a form for student attendance that is bound to a query and stores a temporary value for ClassesAttended in a StudentEnrollment table as faculty enters the attendance. They then run an append query to write the temporary records to a StudentAttendance table. Because the ClassesAttended field is bound, when the form is opened, it recalls the last number entered for that student in that class as entered by the faculty the last time attendance was updated. I tried leaving the field unbound, but the first value enter into the first record of the form is updated automatically to all subsequent records.

Is there a way to change the properities, use code, etc. to assigne a null or 0 to the ClassesAttended field when the form opens, without the first updated record to propagate through the reaming records?

View 3 Replies View Related

Including Columns With No COUNT Values In Crosstab Query.

May 6, 2007

I have a columns that do not incur a count value within the time period of my query, yet i still want them to be displayed with a 0 or no value in the query view, how do i do this?

View 1 Replies View Related

Forms :: Selection From Combo Box - Show Values Of Columns

Jul 17, 2013

I have an unbound combo box with three columns, which get the values from a query. The first column is hidden. When I close the combo box after my selection, only the second column value is shown on the box. Is there any way that both the second and third column being shown on the box after selection?

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

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

Multiple Columns

Aug 17, 2007

I am trying to build a database for my extensive DVD collection and I want something that shows more than one record per line (I ultimately want something with just an image and title for each record with maybe 4 records per line). This is my first venture into using MS Access, but I've gotten the basics down and have already set up the table & form. The only time I have found something that would display the way I want things is in a report, but it will only display it with multiple columns in print preview mode (which won't work because the titles are going to be hyperlinks and need to be clickable). If anyone has any ideas, they would be greatly appreciated. If I'm not on the right track and this can be done from within a form, then please set me straight. Thanks again in advance.

View 3 Replies View Related

Grouping Multiple Columns

Jul 21, 2005

I am trying to display five columns from three seperate tables. I thought the GROUP BY operator would fix this, but I have more than one column to select. The query is fine but I have redundant fields showing. Oh, I'm not worried about the calculation "[employee.salary]*0.1 AS Salary_After_Raise." I just want to concentrate on narrowing the fields down first.

SELECT ID, FirstName, LastName, Salary, [employee.salary]*0.1 AS Salary_After_Raise, City
FROM worksat INNER JOIN store ON worksat.store = store.storenumber, employee
WHERE worksat.store = store.storenumber
GROUP BY city, id, firstname, lastname, salary
ORDER BY city;

View 1 Replies View Related







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