Merge Query Rows In A New One
Apr 15, 2008
Dear Friends,:)
I have 2 tables .. (GroupNo.) & (employee)
The conjunction between them as :
tbl1 tbl2
--------------------------
No. Name
--------------------------
1 John
1 Alian
1 Sali
2 Robert
2 ......
...
..
.
---------------------------
How Can I make a new Query that produce the result as :
1 John,Alian,Sali
2 Robert,.......
3 ......
Kind Regards,
View Replies
ADVERTISEMENT
Apr 26, 2013
I am creating a query to use in a Word 2007 mail merge.
For simplicity, let's say the query has three fields:
schname for school name, role for staff role, and name for the staff member's name.
The current query shows:
SchoolA, Admin, Jerry Garcia
SchoolA, President, Bob Hope
SchoolB, Admin, Janet Jackson
SchoolB, President, Mae West
I would like a query that would show one line per school like so:
SchoolA, Jerry Garcia, Bob Hope
SchoolB, Janet Jackson, Mae West
I've looked at Allen Browne's ConCatRelated function and can pull up a list of all names in a field called Expr1001, but that doesn't seem to be what I need.
View 5 Replies
View Related
Aug 29, 2014
I am trying to merge data from multiple rows into one row for each unique ID. I can replicate on how to do this on a table, maybe a query or something like that. Attached img shows
View 3 Replies
View Related
Nov 21, 2007
Hi all. Is there some way to merge 2 tables into one in a query? Is it possible? Thank u.
View 7 Replies
View Related
Feb 5, 2007
Hey guys,
I'm in need of some help again. I have two tables, Table1 and Table2. I have one field in each table that I want to have the same data. I don't want blanks to be merged, but I want all the data to be the same
for example
Table1
---------
1
3
5
Table2
---------
1
2
4
6
I would like both tables to be merged to show
Table1
-------
1
2
3
4
5
6
Table2
------
1
2
3
4
5
6
But I want to just update both tables and not create anything new.
Sorry if this is unclear
View 2 Replies
View Related
Nov 21, 2007
Dear all
I need to merge a number of databases of the same type into one database in access. can you please help me with code itself.
thanks.
Ampah
View 2 Replies
View Related
Jan 30, 2008
I am making this harder than it has to be i'm sure. I had a previous post of auto-texting a field, well why can't I just take two fields I have, such as the ID field which is an autonumber field and combine that with a type field that I have which is D.
If I could merge this in a query, wouldn't it give me the results as D01, D02, etc?
I couldn't find anything helpful online, one side said do the following.
SELECT receivables2.type+receivables2.ID
FROM receivables2;
Only I get errors.
I also tried this.
SELECT merge(receivables2.type; receivables2.ID);
FROM receivables2;
But it says merge is an invalid expression.
Could someone please help?
View 6 Replies
View Related
Aug 19, 2005
I have a database on a machine with office xp. I store the database in C:Database.
I can run a query then link the results of that query to a template document I have setup via mail merge. The document then opens and fills out the fields based on the query results.
I transferred the database onto another machine with office 2003 and put it in exactly the same directory c:database. and when i try to link the query to word, word just comes up saying it cant find the source.
I have gone around various machines at work and the merge runs fine on all machines with office xp and not with 2003.
Any Ideas?
View 1 Replies
View Related
Sep 13, 2006
I have four tables, each containing name of one family member. Dad, Mom, son, and other. One of the four called us, and in many instances, they ask that we send a letter to them. Sometimes, they say, send the letter to Mom, or send it to dad, or sis. We are creating an automated output query to print one of two letters, to go to the appropriate person. Depending on which person is selected as the one to receive mail, we need to merge out into Word that person's data, which may be in any of the four tables, but is the only one bearing an indicator (checkmark, etc).
Don't know how to word the query to look thru the data on that family (from four tables) and select the indicated one, output the address info.
View 2 Replies
View Related
Sep 15, 2006
I have a form on which users select fields to include in a query and can select their parameters. The query itself is then created using an SQL statement in the VBA behind the form.
I want to be able to use the records which this query selects through mail merge. With a standard query, this is easy because from within Word I can choose the query through the mail merge settings. However, since the query doesn't exist in this case (it is created every time it's run using VBA) I can't figure out how to do it.
Ideally, I want the form to come up during the mail merge process so that the user can specify which records to use, but I can't select a form as a mail merge source.
Can anyone help?
Gary
View 14 Replies
View Related
Apr 16, 2008
Hello,
I wonder if anyone can help I have been using Access Queries in order to create merge letters in Word for years and now we have upgraded to Office 2003 everything seems to be going wrong. This is what I do:
1. Open a query in design view enter the relevant text in the appropriate field in order to select the records I want from the table, then I run it and the correct entries are there.
2. Open a standard letter in Word which was created and has been linked to the above mentioned query years ago.
This is where the problem starts in the past the letter opens up and the correct info is displayed so I go ahead and print. Now what is happening rather then linking to the query it is either displaying the last record that was used or nothing at all and in the record number box it says 0 when I know that there are several selected in the query.
I have tried re doing the merge setup and nothing happens the only way round it I have found is to merge it with the table rather then the query then using the Mail Merge Recipients Box you have to go through and reselect the records you want which is a pain as there are 945 records in the table.
Any ideas/help would be appreciated.
Thanks.
View 1 Replies
View Related
Jan 3, 2005
Happy New Year everyone-- I am trying to use an Access query to create mailing labels- Is there anyway to keep them alphabetized or sorted?
Thanks!
View 3 Replies
View Related
Jul 5, 2012
I am trying to put a button on a form that will run a mail merge to populate a Word (2007) document with information from the single record in the form. I would think this would be easy to do, but after working on it, and searching the internet, I'm finding it is not. Normally I would simply use an Access Report to do this, but the document is about 7 pages long (a contract), and people want to have the ability to modify the result.
What I have done so far:
-I've created a form that displays a single record from my Customers table
-I've created a query that pulls the Customer fields I need, and is filtered on the Customer ID that is active in the form. When I open this query by itself, it pulls back the one record I want.
-I then opened both the form and query, and then run through the External Data - Mail Merge wizard.
Problems I've run into:
1) Initially when I tried to select my query in the Mail Merge Wizard, it wouldn't show. I then found tips to prompt for the data connection type when the file is opened, and to set it to MS Access with DDE. This allowed me to see the query, and seemed to work OK when I added the fields I needed to the Word document. But then when I tried to rerun the Word doc, I would get a connection error. If I run through the connection setup process again, it seems to work, but again when I rerun it later, I get the connection error. For simplicity I have put the Access DB and Word document on my desktop. Eventually these will go on the network.
At this point I have a button on my form, and it successfully opens the Word document, but the "merged" fields just show the record that I had saved the document with, so there is no true merging going on. If I open the Access DB Form & query and then open the Word document directly, I get the error "Word could not re-establish a DDE connection to Microsoft Access to complete the current task".
View 2 Replies
View Related
Jun 3, 2015
it's possible to use a union query as a mail merge? I haven't found anything that says I can't do it, but I'm not getting my merge to complete, and when I switch to a plain query (and not changing anything else) my merge is successful, so I'm thinking there might be a limitation.
View 14 Replies
View Related
Dec 10, 2014
I have a query that as a result like the attachment below and I want to merge in this case all the days in one row, like also says in the pdf file!
Also there is anyway that the query exports it self to a pdf?
View 3 Replies
View Related
Oct 8, 2013
I am using an Access 2010 DB to keep track of a schedule. Essentially, at least one person needs to be signed up to work for every hour of every day in a week.
Tables:
Days with 7 records
Hours with 24 records
Workers with as many people that sign up to work the different hours
Schedule signifying the worker, day, and hour which are signed up.
As of now i have a query that relates these results and gives me a line detailing the worker/time information for the slots that are signed up for.What I'm TRYING to do is to create a query that gives me BLANK worker info when there is no one signed up for a particular hour.Currently my Schedule table has the following:
WorkerID | DayID | HourID
----------+---------+--------
1 | 5 | 12
4 | 5 | 13
16 | 5 | 15
What I'm looking to do is have this table matched up with another table (or query) that provides every combination of day/hour. When an day/hour combination is skipped, the query will be able to "fill in the blank" with a row. Like this:
WorkerID | DayID | HourID
----------+---------+--------
1 | 5 | 12
4 | 5 | 13
| | 14
16 | 5 | 15
View 2 Replies
View Related
Jun 9, 2015
way to merge various fields from a table into just one using a query.The purpose will be for easier copying and pasting in to an email.So we have a table to stores information such as Site Contact, Address 1, Address 2, Address 3, Postcode etc.
I want to be able to run a query that will put the address in to just one box, either in the query or on a report then it's much easier to just highlight the full address and copy and paste it into an email. Rather than copying each field individually.
View 3 Replies
View Related
Aug 27, 2011
Because I have more than 3 queries, it is really hard for me to manage. Therefore, I was thinking of having 3 crosstab queries to show in one single query. This way it will save my time from moving back and forth.
How to do that? Is it possible? If so, how?
View 5 Replies
View Related
Apr 2, 2012
I use an access db that stores our customer info on a mssql backend. I need to be able to create a mail merge based on a customers renewal date. Now I do know how to set parameters in a query but is there a way I can use a access report to enter a month and day they are set to renew then have it create the mail merge based on their info?
The Layout is fairly simple just a renewal notice with what they have on their plan.
View 6 Replies
View Related
May 23, 2005
Hi guys!
I have my word template set up such that some data is copied from the open form into the document and some data is taken from a table which is created from a query based on the content of the form (the record number). This works well HOWEVER (there's always a however isn't there :rolleyes: ) where two users click on the button at exactly the same time or within a very short space of time the query only runs once and either the database crashes (bad) or the document is created for the second person with the wrong data (very bad).
How can I make it so that only one person can run the query at a time (ideally build in a delay in processing so that the query will run for them when the first person has finished...failing that a message to say please try again later)? They will always be working with a different record.
I'm a bit stuck as to what to search for in the forum for an answer to this so haven't really searched.....sorry :(
Many thanks
Jo
View 2 Replies
View Related
Sep 15, 2014
I am trying to create VBA code (I have very little experience of VBA) to recreate a parameter query mail merge, which Access 2013 cannot achieve with the controls provided.I think that I need to assign a variable to the value of a control on my form then assign that variable to the relevant criteria section of my query.
Code:
DIM RefNo as String
DIM IDNo as String
RefNo = Me.[Reference Number].Value
IDNo = Me.Text582.Value
DoCmd.OpenQuery SORTER
How do you paste into criteria?
From there I would like to do a Word Mail Merge by having VBA open a document in Word, then activate the Merge to a New Document instruction.
View 14 Replies
View Related
Aug 30, 2013
I have a query that populates a report linked to a mail merge. There is an IFF statement in it that checks to see if a condition is meet. If that condition is meet some standard text results. Is it possible to put a disclaimer with the standard text.For example,
Code:
IIF ([Results]="Negative","Nothing detected" (the disclamer would go here)
I am not certain the correct syntax to use to insert "not all regions were tested".
View 1 Replies
View Related
Jun 29, 2005
Hi, I am totally out of my depth on this one. I have managed to find ways to solve my other problems but this one won't seem to budge.
I have one large table ALLENGPUMP which has columns of data and other columns of lookups to associated tables. What I am trying to achieve is that by selecting a value from a combo box (which contains the results of: SELECT DISTINCT ALLENGPUMP.Coupling_Order_code FROM ALLENGPUMP; ) a list box will show all of the other columns from the table (and the associated tables).
In lstOther3 and lstOther4 the columns sought are in the same table and this will produce a result of multiple rows when the Coupling_Order_Code is apparent for more than one ID, as required.
lstOther5 contains the columns with lookups and only works when the Coupling_Order_Code returns only one ID. When more than one ID is returned it no longer functions and returns nothing. The best I have so far is shown below (this is from VBA) although lstOther5 only has one of the columns I am looking up whereas there are 5 in total for the data in 5 other tables.
So, to recap, the user chooses one of the list of Coupling_Order_Codes, this returns the ID for all rows that contains the Coupling_Order_Code. From these IDs I want a list box to show the data held in all of these rows, including the lookups to the associated tables.
Dim GvarCPLG_Ord As String
Private Sub cbCPLG_Ord_AfterUpdate()
GvarCPLG_Ord = Me.cbCPLG_Ord
Me.lstOther3.RowSource = "SELECT DISTINCT ALLENGPUMP.ID, ALLENGPUMP.DRW_ID, ALLENGPUMP.FW_No, ALLENGPUMP.FLANGE_MOUNTING, ALLENGPUMP.SHAFT_DETAILS, ALLENGPUMP.SHAFT_LENGTH FROM ALLENGPUMP WHERE (((ALLENGPUMP.Coupling_Order_code)=""" & GvarCPLG_Ord & """))"
Me.lstOther3.Requery
Me.lstOther4.RowSource = "SELECT DISTINCT ALLENGPUMP.ID, ALLENGPUMP.DRW_ID, ALLENGPUMP.COUPLING_REF, ALLENGPUMP.Coupling_Order_code, ALLENGPUMP.DRAWING_No FROM ALLENGPUMP WHERE (((ALLENGPUMP.Coupling_Order_code)=""" & GvarCPLG_Ord & """))"
Me.lstOther4.Requery
Me.lstOther5.RowSource = "SELECT ALLENGPUMP.ENGMOD_ID, ENGMOD.ENGINE_Model FROM ENGMOD INNER JOIN ALLENGPUMP ON ENGMOD.ID = ALLENGPUMP.ENGMOD_ID WHERE (((ALLENGPUMP.ID) = (SELECT ALLENGPUMP.ID FROM ALLENGPUMP WHERE (((ALLENGPUMP.Coupling_Order_code)=""" & GvarCPLG_Ord & """)))))"
Me.lstOther5.Requery
End Sub
Any help at all would be very, very, very much appreciated.
Thanks, Brodie
View 4 Replies
View Related
Aug 26, 2006
is it possible to compare values in 2 different rows? for example if the query returns this:
1 | $5.00
2 | $6.00
3 | $20.00
4 | $30.00
i want to find out the cost difference between 1 and 2 which will be $6-$5 and then 2 and 3 which will be $20-$6 and so on. how can i make this happen in SQL? any suggestions?
View 6 Replies
View Related
Jan 30, 2007
Hi ,
I need to copy rows from a table to a specific location in the same table.
I suppose that it is possible to copy rows from a table to the same table
as followed :
INSERT INTO Table
SELECT * FROM Table
WHERE Condition
How can I insert into a specific location based on another condition. ?
Thanks for the help .
View 14 Replies
View Related
Oct 12, 2007
I've been toying with this for a few hours but I always end up with the wrong result. Hopefully an expert here can provide some insight. I have a table called colors with two columns PNAME and COLOR. There are various products and only three possible colors. E.g:
Tablename: COLORS
PNAME COLOR
-----------------------
tshirt blue
pants blue
jacket blue
jacket green
shoes green
vest black
Now what I'm trying to do is create a single query that would provide me with the count of colors in three different columns.
E.g
Blue Green Black
-----------------------
3 2 1
I can get these results easily by creating several queries and then getting the results into one query from these, but I'm trying to learn how to put together nested queries. Any help would be greatly appreciated.
View 12 Replies
View Related