How Do I Create A Query To Move 2 Fields On The Same Row To Be 2 Rows In One Field
Jun 6, 2007
Hello,
I have a big table like this:
ID Name Race1 Race2 Race3
-- ---- ----- ----- -----
1 a Asian russian
How do I create a query to be like this (either in query or report)?
I like to combine three fields (race1, race2, race3) in one field (Race), and break any value of races to the 2nd line, 3rd line, if there is a value...
ID Name Race
-- --- ----
1 a Asian
Russian
In Oracle and SQL Server, we can combine a few rows to be columns-like, but in Access, is there any way to do that? and how?
Thanks so much!
Jenny.
View Replies
ADVERTISEMENT
Mar 14, 2008
I've got a fields called rev code that contain the following values:
field name: 110 131 250 255 258
field value: 7.49 6 11.25 12.11 78
I'm writing a query that pulls from the first two digits of the rev code and need to round off to the nearest dollar so in my query I'll have a column 11 with a value of 7, a column 13 with a value of 6, then I need to take columns 250 255 and 255 add the values together and round off so I get a column 25 with a value of 101.
How do I do that?
View 14 Replies
View Related
Mar 11, 2007
Hi, I have data from a form on my website in a text file, that corresponds to each visitor's input, each 13 lines in the form belongs to one visitor, as shown (twice) at the end of this message.
What I would like to do is have each visitors inputs translated to ONE row, with 13 columns/fields each. It could be appended to the same table or preferably generated in a new one. Note, there are no blank fields, some won't have data after their title, i.e. addy_line_2: is often blank, but at the very least, addy_line_2: or another field name is always there.
It would ROCK if I could also automatically take the name of each field out, i.e. each name is continuous characters up to the : (colon) ...
Thanks in advance, my Access knowledge is obviously limited, I'm sure this is fairly simple!
The fields:
Phone: 213-555-1212
Submit: Continue
addy_line_1: 1000 Melrose Place
addy_line_2:
badge:
city: Los Angeles
email:
homegroup:
name:
program:
state: CA
volunteer:
zip:
Phone:
Submit: Continue
addy_line_1:
addy_line_2:
badge:
city:
email:
homegroup:
name:
program:
state:
volunteer:
zip:
thank you thank you thank you thank you thank you !!
View 1 Replies
View Related
Jul 7, 2013
Create a query to show rows with timestamps in between two timestamps? my variables are cutoff time and the current time where cutoff time is saved on a table (tblcontroltable.cutoff ) a pseudo code of what i want to achieve is
select date, product, timestamps
from tblsample
where date = date and timestamps > cutoff and timestamps < time
View 4 Replies
View Related
Jun 5, 2007
Hello All,
I am trying to figure out the best was to combine fields from multiple rows into one row & field.
Example: I have a table that contains footnotes and products. With a simple query I would get the following 3 rows:
Product........................................... .......Footnote
V.I. Capital Appreciation Fund.................3
V.I. Capital Appreciation Fund.................5
V.I. Capital Appreciation Fund.................1
What I want is one row and the 3 footnotes combines into one field:
Product........................................... .......Footnote
V.I. Capital Appreciation Fund.................3, 5 ,1
Any help would be greatly appreciated.
View 14 Replies
View Related
Sep 5, 2007
Hi
I need to know if it is possible to create a delete query which will target particular fields in a row based on certain criteria in a seperate combo box(on same table).
The few ways that I have tried to do this have been unsuccesful so if anyone can shed some light on the subject it would be greatly appreciated.
View 5 Replies
View Related
Mar 23, 2012
I am using Access 2007. I have an ODBC source feeding data into a table, to which I made a crosstab query that displays the useful data from that source. I need a way to add data(new field), using a form, that is a associated with the lines in the query. I've tried creating another table that uses the sample ID as the primary key, but I need it to automatically create a new row for each query line. Is there a way to do this, or better way to add data to a query. Examples are below.
The ODBC data looks something like this
SampleID PeakName Conc
sample1 THF 50
sample1 MEOH 10
sample1 propanol 25
sample1 butanol 15
sample2 THF 21
sample2 MEOH 15
sample2 propanol 17
sample2 butanol 23
I have the query look like:
SampleID THF MEOH propanol butanol (I need to be able to add a field here)
sample1 50 10 25 15
sample2 21 15 17 23
Linked table I created:
SampleID LIMS #
sample1 1234567
sample2 4567891
The problem is, for this table I have to manually select each sample ID. I want it to automatically add the sample IDs as new ones are querried.
View 3 Replies
View Related
Oct 16, 2013
I have a database where on the bottom I have kept the record navigation buttons. When I move to the next record is fine, but when it reaches the end and I press once more, it will create a new one. How can I avoid this?
I made a button special for that purpose to creat new record). I guess the best option will be not to show the record navigation and create buttons to go back and forward and avoid that the next press of the button will create new record.
View 3 Replies
View Related
Feb 20, 2007
I am editing data in a table that was designed by someone else. For some reason, they divided the date into three columns (YR, MON, DAY). I would like to join these three fields together and create a legal DATE field. I have tried the following:
SELECT YR AND MON AND DAY AS TheDate
FROM MyTable;
However, it returns an odd result. I think this might be because ACCESS does not know I want a date format.
My question is: is the above QUERY correct and how do I tell ACCESS to put the concatenated data in a date format.
Thanks in advance for any help you can provide...
View 5 Replies
View Related
Aug 19, 2013
The interface being used is a main form with various tabs and a subform on each of these tabs.
There is one field ('max power density') in my database that is calculated using 'Max Rated Power' and 'Cylinder Capacity' however these are in different tables and subforms. The 'max power density' and 'max rated power' are in table and subform 1 but 'cylinder capacity' is in table and subform 2. Is it possible to keep them in separate tables/subforms and still calculate the field?
View 7 Replies
View Related
Jul 23, 2015
Is there a way of merging 2 fields together to create an additional field
my database consists of 4 main tables (in order of relationships)
*HeadOfficeDetails
*SiteDetails
*ContainersOnSite *Contracts2015-2016
For example;
Account Reference: TEST
Site Number: 001
and the field i would like to have;
Site Reference: TEST/001
I would also like that when i add a new site to that account i will have TEST/002....
View 4 Replies
View Related
Mar 14, 2014
All, using access 2010. I am working with an existing database that have a letter programmed using fields in a query. I have to add to it but having a trouble. Merge in Word was not used. I can't find any examples. The letter is designed in a report design. Using the fields from a query and filtered by "IIF Statements".
View 3 Replies
View Related
Aug 14, 2013
i essentially have 2 table:
1. Table BIC
A list of codes that will be updated monthly, which will be the basis for querying the second table. Approx 100 rows of data.
2. Table Original
A data file obtained from IT where i'll need to sort it to find any codes that are including in Table1. This includes approx ~ 10,000 row of data.
** note, the "BIC" from "Table BIC" can appear in any of the 5 BIC columns in Table Original.
What i need to do is create a query that will:
1. Search the "BIC" from "Table BIC" in all 5 columns of "Table Original".
2. Where it has a hit, it will create new table - for example, the first row of table Original includes the BIC "ABC" in the "BIC 1" column. A query would create table "ABC" and place this whole record (all 8 fields) in new table "ABC". No modification needed.
3. Where two (or more) BIC's from "Table BIC" appear in one record in "Table Original" - the result will only need to be placed in one of the new tables (really doesn't matter which one). For example, Record #4 includes the BIC "ABC" in field "BIC1" and the BIC "DEF" in the field "BIC4". Therefore, a new table would be created (either ABC or DEF) to capture this information.
View 4 Replies
View Related
Apr 11, 2013
I'm trying to create a query that can sum values of different fields in different tables...Can I sum values of a field and put the result into another field in different table?
View 3 Replies
View Related
Nov 22, 2014
the below code works fine if i run a crosstab on a whole table however if i pass criteria to the crosstab e.g between [forms]![form]![txtstartdate] and [forms]![form]![enddate] it fails and returns null for every field? even though if set docmd.runquery "qryReductionByPhysician_Crosstab" this opens with the relevant data?
Code:
Set db = CurrentDb
Set qdf = db.QueryDefs("qryReductionByPhysician_Crosstab")
indexx = 0
[code].....
View 7 Replies
View Related
Mar 6, 2014
I am trying to take a table that looks like this:
Customer Name
Fruit
Customer A
Apples
Customer A
Bananas
Customer B
Pears
Customer B
Apples
Customer C
Pears
And create a table that looks like this:
Customer Name
Apples
Bananas
Pears
Customer A
Apples
Bananas
Customer B
Apples
Pears
Customer C
Pears
I think this is relatively simple but don't know the syntax to create this table.
View 2 Replies
View Related
Apr 23, 2014
I'm trying to build a command button to parse each line into a new record of my table [TBLRECORDS].I am able to parse a single line using this code but don't know how to insert the data into the table and loop through for all lines in my [memFile] control
On a form I have a text control [memFile].I populate it by pasting text from the body of an email into it and it is stored in a tables memo field [TBLFILES].[TEXTFILE].Each email can have countless rows of data in this format
H E74 Warranty end not prior to Serv start for XRC Status: M RecordId=897*7756*33*1D1PMB*20140418
H E74 Warranty end not prior to Serv start for XRC Status: M RecordId=897*7916*68*A1C558*20140418
Each line of data will always begin with "H " and each line of text will always have the same character count..For each line in me.memFile I want to create a new table record and populate this way
[TBLRECORDS][TXTTYPE] = strType
[TBLRECORDS][TXTCODE] = strCode
[code]....
View 5 Replies
View Related
Aug 16, 2007
As I usually concentrate on building the tables and fields in my initial stage, and do some experimenting to analyze the relationship.
However, when I'm done, I find it quite a hassle to go manually through the tables to add description to each field for documenting.
What I would like to do is create a query that will list all fields and its description. Now, I have found codes to retrieve either table or fields properties, including the description property, but am kind of stumped on how I can make it a SQL statement so I can create a temporary query, which will be pretty be one time thing, that can read all fields' description and allow me to type in it, save it.
If that's not possible, I suppose I could write code, using Allen Browne's example, that would loop through the fields' description, debugging to the immediate window and prompting me if I would like to add something to the blank description. However, this isn't exactly greatest as I need to see all fields so I can be sure I'm giving good descriptions.
I figured someone may have had this same problem and maybe came up with a solution?
View 4 Replies
View Related
May 25, 2014
Have a Make table query that needs to create (add) several new fields where each field must be numeric design.
Have tried:
Score1: Not Null - does not seem to work (results in a Binary field)
Score1: 0 - which does give me the numeric field designation but every field in table contains a 0.
Would like to show Blank field (makes data input easier at a later time) but still have the Numeric designation.
View 6 Replies
View Related
Mar 18, 2014
I would like to make a form that can insert more than one row at one time. Something like add first column, then ask the user how many of the second row they would like, then prompt them for what is in the second row then add the information for the rest of the columns and have a separate row for each of the second column. So every row with have the same first column, but from there have a different row for how ever many desired in second column. So lets i enter for the first column, ABC, then I wanted 3 rows with ABC, then prompts me for the rest of the information for each of those rows separately.Something looking like this, oh and it would be updating an already existing table.
ABC|asdf|asdf|hgaf
ABC|hs|hasd|auio
ABC|JKL|ASE|ASDF
EDIT: I would also like to know if it is possible so it does it in ranges and dont have to do it manually like you enter the first column then enter a range for the second column and a bunch of rows are made with each value in between the range that was specified.
View 1 Replies
View Related
Jun 4, 2014
I have an issue with a code that I have in a form which adds rows in a table as many times as categories chosen from a list. However, the code is not working correctly: it adds the information and creates a row with a category in blank, in addition to the rest of the rows with one of the chosen categories. I would like for this not to happen, to add only as many rows as the categories chosen.
My code is the following:
Private Sub cmdUpdate_Click()
Dim valSelect As Variant, MyDB As DAO.Database, MyRS As DAO.Recordset
Set MyDB = CurrentDb()
Set MyRS = MyDB.OpenRecordset("Tasks", dbOpenDynaset)
MyRS.MoveFirst
[Code] .....
View 6 Replies
View Related
Oct 15, 2014
I've just created a form and I'm trying to move and size the fields but they seem to be grouped together and whatever I do to one happens to all of them. I select one field and just that field has the orange outline but when I move it they all move.
View 5 Replies
View Related
Aug 19, 2015
I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.
Customers(mfrm)....>Addresses(sfrm)...>Orders(sfrm Add)......>OrdDetails(sfrmOrders)
Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.
View 2 Replies
View Related
Aug 27, 2014
What is the best way to move from the last field on the last page of a form to a new record field on the first page?
View 5 Replies
View Related
Aug 5, 2015
[URL] .....
In the Lesson tutorial shown above I am clicking on tools and adding existing fields. I get a lot of output label and text box pairs for each field that I add.
However, they are all on right below the other. That is no problem just move them. No way.
Whenever, I move it a label and test box for say Order Status, I get ... nothing. It stays where it is.
They (label and text box) do not move together. So how do I get them to move together.
View 4 Replies
View Related
Apr 15, 2014
I have a table with the following columns: Task, Visa type, time it takes to perform the task. There are several taks that are performed for all visa types. I want to create a form to enter data to the table in which for the field visa type I have a list box that can allow multiple values, however, I do not to create a single line with the task and on visa type all the types of visas selected. I want to create a line for each type of visa with the information introduced.
I don't know if this is possible, the reason for which I want for the form to create several rows depending on the visas types is because then I have a query that sums all the types of visas. Can this be possible? I don't want the people to introduce manually directly to the table the data and also that for the same taks they have to enter manually 50 rows with values. I want it to be more simple and easier.
View 3 Replies
View Related