Splitting A Field Into Many Rows

Feb 1, 2006

Hi all,

I have a problem this is part of my database

ID NAME DATARANGE ck1 ck2
1 dave 23-Jan-06,24-Jan-06,30-May-06 dataprojector s/table
2 John 23-Feb-06,24-Mar-06,30-Apr-06 s/table

What i would like to do is to run an maketable / updatetable query that splits out the daterange dates into seperate rows and also if there is a value in ck1 or ck2 replace the current value with either a 1 or 0.

So the above table would look like this.

ID NAME DATARANGE ck1 ck2
1 dave 23-Jan-06 1 1
2 dave 24-Jan-06 1 1
.
.
.
?? John 23-Feb-06 0 1
John 24-Mar-06 0 1

ETC

is this possible any help would be greatful

Thanks

Dave

View Replies


ADVERTISEMENT

Splitting A Row In A Table Into 2 Or More Rows?

Apr 5, 2012

I am working on a project that requires to calculate interest on the amount. There are 2 tables, 1 with Interest rate for a product for different and periods and another is product table with amounts in different period.

Table 1 (Rates table)

Product From To Rate
1111 1/1/2012 1/20/2012 .75
1111 1/20/2012 1/28/2012 .50
1111 1/28/2012 4/6/2012 .40

Table 2 (Product table)
Product From To Amount
1111 1/1/2012 1/17/2012 10000
1111 1/17/2012 1/24/2012 15000
1111 1/24/2012 2/25/2012 20000

What i need to do is to calculate interset based on the above 2 table and insert into another table (Interest). However, the problem is with identifying correct rates for the periods in Table 2.

Eg.

for period 1/1 to 1/17: applicable rate would be .75

for period 1/17 to 1/24: From 1/17 to 1/20 the rate would be .75 and from 1/20 to 1/24 it would be .50

this is what i want to achieve, basically to split the period between 1/17 to 1/24 into 2 so that appropriate rate can be applied.

View 1 Replies View Related

General :: Splitting Quantity Into Separate Rows

Mar 5, 2013

I have a query that holds info for a WORK ORDER FORM. E.G The work order requests 3 staff member.

Is there a way to have a separate table or query split this quantity into three rows so i can assign an employee to each request?

I sometimes get requests for 20-30 staff and dont really want to add lines manually.

View 1 Replies View Related

Splitting Field - SQL?

Jan 30, 2008

Hello again!

Hoping to use SQL to do this in a query.

In a table I have linked to a text document (have to do it that way) there is a field that holds multiple values.

Meaning there can be some fields with nothing, some with a -, soem with a 3 digit number, some with a single digit followed by a space and then a 3 digit number, and lastly a 10 character text with spaces between each.

What i want to do in the query is when it looks at that field, create 2 fields out of it.

When its the 5 character value (the one that is like '2 345') split it, place the 2 in the first new field, and the 345 in the second new field. If the value in the originals field is not in that format, jsut carry over the value to the second new field.

does that make sense?? haha

thanks in advance!

View 2 Replies View Related

Splitting Values In A Field

Sep 28, 2005

I have a field - Period in the format YYYYMM.

How can I split this value so that I only extract YYYY?

Thanks

P

View 2 Replies View Related

Field Splitting...has Different Separators

Apr 11, 2008

I have been able to do this with a work around but it is slow and cumbersone when lots of records are involved and am hoping there is a "proper way" to edo it.

--(&100,,,, 200 ---() 300,400- (500),,,, --600

6 is the maximum number of alpha/number entities and down to ----john etc. Result to be

100 200 300 400 500 600

There can also be a mixture as in

--(&John,,,, 200 ---() Andrews,400- (500),,,, --600

John 200 Andrews 400 500 600

View 5 Replies View Related

Splitting Field Values

Aug 9, 2005

I have a db with a field that I need to split and put values into two other fields. The format of field1 is either a-b, aa-b, aa-bb, or a-bb. I want to take the value before the "-" and put it into field2 and then take the value after the "-" and put it into field3 and then delete field1. Is there a straightforward way to do this? I want to do it in the query design grid so let me know what should be in the "criteria" line versus the "update to" line.

I'm using Access 2000 and have approx 5500 records to convert.

Thanks!!

Tom

View 2 Replies View Related

Splitting Records From 1 Field

Aug 24, 2004

Lo All,

i need to split records from a field
db - online
table - merk
field - merkCat

in the field i have - 1,2,3

now i send a string bla.asp?cat=1

i want to loop thru the db , but only show the records which actually have the 1 represented
in the merkCat field. Not all fields have that. So far i have selected the db and
i loop thru it , but somehow it wont split up

A little help by pointing me to some cool scrippy would be very helpful

thnx in advance.

View 2 Replies View Related

Splitting Name Field Into Two Columns

May 3, 2012

I have to split a filed that has Lname, Fname into two columns of Lname and Fname. I know how to do this in Excel (using left, right by calculating the len using the comma) but i don't know the functions or the code to do this in Access.

View 3 Replies View Related

Complex Field Splitting Problem

Jul 20, 2005

OK Guys,
I am building a sales database for a client he has supplied the text files which I have loaded into tables.
Problem on the sales file there are multiple part numbers in the part field these are separated by '-' the same format is on the Qty and value fields. The logic behind this is:
For the 1st part in the part field the qty and the value are the 1st in there respective columns, for the 2nd part in the part field the Qty an value are the 2nd in there respective columns and so on eg


PS001 |BAGR3-BAGR4-BAGR6 |03-01-01 |4.29-5.17-5.99

How would I get above to look like this:


PS001 |BAGR3|03 |4.29
PS001 |BAGR4|01 |5.17
PS001 |BAGR6|01 |5.99

Any suggestions would be great

thanks

Chris

View 8 Replies View Related

Splitting A Comma Separated Field Into 4

Jan 30, 2007

Hi
I'm having a senior moment...

I have a reference field - examples below and need to split into the component parts

example Ref_IDs:
C21/0051,Sheet 18, Sheet 19, E 3, 12/01/07
C21/0052.04, Sheet21 ,E 2
C21/0054, Sheet 23, B 2, 05/01/07

First - ref no, Second - Sheet (note some have more than one), Third - Grid and lastly some have dates, but not all

View 6 Replies View Related

Tables :: Splitting A Field That Contains A Digit

Jun 29, 2015

I am trying to split a field that contains a digit, so lets say the field contains the digit 7, I need it split into 7 fields. How I can do this?

View 4 Replies View Related

Splitting A Field’s Data Into Multiple Fields

Jun 8, 2006

Hi All

Been handed a contacts database, one field of the DB includes all the industry sectors associated with the customer, with multiple industry references separated only by a comma within the field (e.g. Insurance-Life,Insurance-Broking,Insurance-Motor,Insurance-Pensions,Insurance-Home,Insurance-Health) – I want to split this one field into multiple fields using the comma as the break point (this is something that’s relative easy to do in Excel with the ‘Text to Columns’ tool – but unfortunately it can’t take the 130,000 odd records of the databasel)

Can any one recommend an expression or method that will see the 6 industry references split into 6 separate fields ?

Thanks

Jim

View 1 Replies View Related

Queries :: Splitting Text Field Into Columns

Feb 15, 2014

Is there a function or query that I can split a field into different columns?

For example, I have First Name, Last Name, Address.

But I want to split the address field into Address1, Address2, Address3, Address4 as the initial Address field has a lot of characters with commas e.g. 11 London Road, Liketown, Likeshire, London.

So, I want to be Address1: 11 London Road, Address2: Liketown, Address3: Likeshire, Address4: London.

I thought that I can export the field using a simple query and then re-import it with using the text field into columns option, but it is time consuming.

View 2 Replies View Related

Tables :: Splitting Attachment Field From Table

Jul 4, 2013

I have a database composed of personal statistics. (name, age, height, wt, etc). I have two attachment fields. Photos and Videos. Each of these fields can contain more that one file. The size of the video attachments is starting to get me up close to the 2 GB database limit. If each attachment field contained only one file, I would convert the fields over to a path link. I'm stumped on how to move the files out of the main database to control the size, but maintain the multi-file link to my forms. How to restructure this?

View 4 Replies View Related

Splitting Text Values From A String Into Separate Field

Jan 25, 2005

I have a table field which long ago was merged from several other fields. When the data was merged into the field it was delimited by "1." then "2." up to "5."
Example: MergedField = "1.Animal 2.Large 3.African 4.Grey 5.Long Nose"

I now want to split it appart in a query where "1.Animal" goes into expression1, "2.Large" goes into expression2, etc.

I need to base the text on where the one number begins and grab everything until the next number in the mergefield is detected.

Can someone show me the syntax for this.

Thanks!

View 1 Replies View Related

Queries :: Update Fields By Splitting Text From Other Field

Nov 28, 2014

I have one field called FULL_ADDRESS. From that field I am going to populate two other fields. One called ADD_1 and the other, ADD_2.

In the FULL_ADDRESS field I have the following text :

"BOX 2747 ROCKY MOUNTAIN HOUSE AB T4T 1L7"

I want ADD_1 updated to:

"BOX 2747 ROCKY MOUNTAIN HOUSE AB"

and ADD_2 updated to:

"T4T 1L7"

While I understand how to do an update if I was using a space as a reference, i.e.

Trim(Left([FULL_ADDRESS],Instrrev([FULL_ADDRESS]," ")-1))
Trim(Mid([FULL_ADDRESS],Instrrev([A]," ")+1))

I can't figure out how to skip the first space from the right, and reference to the second occurring space, so that I get "T4T 1L7" to populate the ADD_2 field, and everything to the left of "T4T 1L7" placed in the ADD_1 field.

View 6 Replies View Related

Modules & VBA :: Splitting Dataset Sorted On Two Fields Based On Change In Value In One Field

Feb 6, 2014

I am new to MS Access, and am not sure if what I want to do is even possible. It is my understanding that comparing subsequent cells within a field in a database cannot be done- so I thought I'd see if there is a way to go around it.

I have a dataset for pedestrian activity, with over 3 million rows and 40 columns - too big for excel to handle.

I need to sort the entire dataset by 2 fields, following which I need to search down the field containing my pedestrian ids (numbered 1, 2, 3... till approx 10000), and when my ped id changes from one to the next, I need to check the value in a field showing the ped location, and if that matches with the ped's previous location, I need to copy out a cell corresponding to the previous cell's time stamp. If it doesn't match, I need to copy out another time stamp from another field.

View 1 Replies View Related

Reports :: Splitting Single Field Into Multiple Text Boxes Or Multiline Text Box

Jun 4, 2013

I have a single field in a table called "Client Contact", where users enter a semicolon between the name, address, and city state & zip. My reason for this was so we could copy client info with a single copy and paste (like from an email). But, on the final report, it needs to have these three parts split up into different lines, or even different textboxes. I can't find a way to do that.

View 1 Replies View Related

Combine Multiple Rows Into One Field?

Mar 28, 2008

Hello,

I am trying to find a way to combine multiple rows into one (field). I have 2 tables. One table is data the other table is notes. The notes table has a new record created for each new note. Both tables have the Account Number and and Sub Account Number. I am linking the two tables on these account numbers with a left join normally. There can be records in the data table and no records in the notes table. I guess what I want is a query or sql statement i can use in vba that will display all the data from the data table and all the notes from the notes table in on field.

This data is used in a large report. Right now I have the data table set to the report by itself and code on the report to pull the notes from the notes table using a ADO recordset with a do while that just adds each note to a single variable. This works fine and does the job. The only problem is the time it takes to run the report now. If the report has 1000 records with notes on 90% of them and each of those has multiple notes that recordset code has to run thu ALOT. I use to have all the notes just compile to one field in the data table and the report ran very fast that way. I had to change this since I need it this way as to filter notes by time and archive them after a period.

I have read thru so many posts and see lots of code functions to do this but its just the same thing I already have with the recordset code building the combined field. Any other way to do what I am trying? I think I have just been over thinking this stuff at this point an maybe a fresh set of eyes will help. Below are some simple table layouts for the 2.

**Account Number and Sub ID fields in both tables are not unquie.

Data Table: (this table has alot more data but this gives you the idea.)
Account_NUM - Sub_ID - Data1
1234 | 3 | 123 N Inc.
1234 | 3 | 666 DRN
4567 | 4 | 543 S Way.
7890 | 5 | zzz ABC

Notes Table: (Yes the notes field is a MEMO field)
Account_Num - Sub_ID - Notes
1234 | 3 | notes1
1234 | 3 | notes2
1234 | 3 | notes3


The output I am trying to Get:
Account_Num - Sub_ID - Data1 - Notes
1234 | 3 | 123 N Inc. | notes1 notes2 notes3
1234 | 3 | 666 DRN | notes1 notes2 notes3
4567 | 4 | 543 S Way. | NULL
7890 | 5 | zzz ABC | NULL

Thank you for any advice or thoughts.

Joe

View 2 Replies View Related

Queries :: Combining Rows Into One Field

May 12, 2013

So in my example you have a Weld (tblWelding_WeldingID) and each weld can have more than 1 consumable (tblconsumables_consumableID). have a third table that links the two, trackID,consumableID, weldingID)

What I need to be able to do in a report, is under the heading COnsumable, list the 1 or many consumables.

Also you select the consumable from a combo box..... if that just makes it that much harder...

View 2 Replies View Related

Combining Fields From Multiple Rows Into One Row & Field

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

Reports :: Join Together Multiple Rows To One Field?

Jul 1, 2015

I have been struggling with combining multiple rows into one row for an order summary report.

Specifically, I have three tables (Products, Orders, and OrderDetails)

Products
=======
ProductID = AutoNumber
ProductName = String

Orders
======
OrderID = AutoNumber
OrderDate = Date/Time
OrderInfo = Memo
CustomerName = Text
CustomerAddress = Text
PaymentDetails = Text

OrderProductDetails
=========
OrderNumber = Number (Linked to OrderID)
ProductNumber = Number (Linked to ProductID)
Notes = Memo (Notes on product customization)

The OrderProductDetails table is in many to one relationships with both Orders and Products table. If I place an order with 3 products, the OrderProductDetails datasheet would be:

OrderNumber ProductNumber
========================
1 78 (Product 1)
1 89 (Product 2)
1 56 (Product 3)

On my report, instead of 3 entries for this order, I would like show just one entry under a column "Products Ordered" ---> Product 1, Product 2, Product 3.

I tried the Concatenate macros I found online, however, I am unable to configure them properly to use for this purpose.

I am using Access 2010.

View 10 Replies View Related

Modules & VBA :: Concatenate Multiple Rows Into One Field

Nov 16, 2013

I have a table:

"tb_skybox_Types", with the fields, [Policy_URN], [Box_Type]

Sample:

Policy_URN Box_Type
001 Standard
001 Sky HD
002 Sky +
002 Sky + HD

I'm mail merging this, so naturally it's giving me a row per box type against which I need to be one. Desired output:

Policy_URN Box_Type
001 Standard | Sky HD
002 Sky + | Sky + HD

I'm then going to make this into a temp table, then match the URN back to the customer table to get a single row per customer.

View 3 Replies View Related

Reports :: Concatenate Multiple Rows Into 1 Field

Jun 18, 2013

My database has a 'markets' table, where there could be multiple markets per campaign.

So right now in my report, it's displaying like this

campaign 1
Market 1
Market 2
Market 3
Etc.

Is there a way, to Concatenate multiple rows into 1 field. So it would look something like this

Campaign 1
Market 1, Market 2, Market 3

That would save a lot of space in the report, and make it easier to read.

View 11 Replies View Related

Queries :: Comparing Two Values From Rows In Same Field

Jul 10, 2013

I have a table [VL] with four fields, [vl_id], [product], [vl_date], [valeur_liquidative].

The idea of the table is that you can input and update the value of each product on a given day.

I need to find the difference in days between successive dates (vl_date) each time that a product value (valeur_liquidative) is updated. Values aren't updated everyday as it is not updated during the weekends. I have had a go at this but have struggled..

A picture of what the table looks like is attached for reference.

View 9 Replies View Related







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