473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Adding Rows

I have a unique situation that I'm not sure how to solve:

I have many fields but I only want to change one field. For example.

Field 11
972.00^05001200^

This contains a dollar amount as well as time in military time. Where I have
times that are between 05001200 I want to split the data out so that it
reflects two times. 05000559 and 06001200. I want to split it out and
create a new row with all the same information in the fields but instead of
having one row that is 05001200 it would have two such as 05000559 and
06001200.

I also want to change the second dollar amount from 972.00 to 0.00 as the
second time won't have a dollar amount associated with it. I know this is
sort of confusing but any help will be much appreciated.

Thanks,

Chuck

--
Message posted via http://www.accessmonster.com
Mar 7 '06 #1
1 1363
Br
chuck via AccessMonster.com wrote:
I have a unique situation that I'm not sure how to solve:

I have many fields but I only want to change one field. For example.

Field 11
972.00^05001200^

This contains a dollar amount as well as time in military time.
Where I have times that are between 05001200 I want to split the data
out so that it reflects two times. 05000559 and 06001200. I want to
split it out and create a new row with all the same information in
the fields but instead of having one row that is 05001200 it would
have two such as 05000559 and 06001200.

I also want to change the second dollar amount from 972.00 to 0.00 as
the second time won't have a dollar amount associated with it. I
know this is sort of confusing but any help will be much appreciated.

Thanks,

Chuck

I think you'd need to do two passes, one for each new record:

(I don't know how the time works so I've made some assumptions)

INSERT INTO tblTest ( Field11 )
SELECT "000.00^" & Mid([Field11],8,4) & "0559^"
FROM tblTest
WHERE (((Right([Field11],5))="1200^"));

INSERT INTO tblTest ( Field11 )
SELECT "000.00^" & Format(CLng(Mid([Field11],8,2))+1,"00") & "001200^" AS
Expr1
FROM tblTest
WHERE (((Right([Field11],5))="1200^"));

--
regards,

Br@dley
Mar 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Garry | last post by:
Hi, I am new to python, hope someone can help me here: I have a MS Access exported .txt file which is tab delimited in total 20 columns, now I need to add another column of zero at the 4th column...
4
by: David Link | last post by:
Hi, Why does adding SUM and GROUP BY destroy performance? details follow. Thanks, David Link s1.sql: SELECT t.tid, t.title, COALESCE(s0c100r100.units, 0) as w0c100r100units,
4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
2
by: Praveen Balanagendra via .NET 247 | last post by:
here is the source code private void AddRow() { TableCell tc = new TableCell(); tc.Controls.Add(new LiteralControl("NewRow")); DataGridItem di = new...
0
by: Sileesh | last post by:
Hi I have html table and a Button in an Aspx page. I am adding one row with some textboxes to Html table each time i click on the Button thru Javascript. Now problem is when when i try to...
0
by: Luis Esteban Valencia | last post by:
Hello I wrote a program with code behind in C# to add row into table dynamically and the program worked very well in .Net Framework 1.1. When I run this program in .Net Framework 2.0 beta...
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
12
by: JMO | last post by:
I can import a csv file with no problem. I can also add columns to the datagrid upon import. I want to be able to start importing at the 3rd row. This will pick up the headers necessary for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.