473,326 Members | 2,113 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,326 software developers and data experts.

Erasing part of a text string

Hi,

I need to convert a text field into a number in order to perform calculation with it. However the data in the field has characters in like this:

24 hrs
3456 hrs
48 hrs
etc.

Is there any way of writing a query which removes the 'hrs' from every record ?
May 23 '07 #1
2 1245
missinglinq
3,532 Expert 2GB
Why not simply use val(HoursField)?
May 23 '07 #2
Why not simply use val(HoursField)?
Thanks Missinglinq, that a lot easier than the way someone else has just suggested.

(Add a new filed to your table defined as a number

Create a new query, without adding any tables.
Click on the SQL button & paste the following SQL in (amended with the correct details)

UPDATE TABLENAME SET TABLENAME.[NEW FIELD NAME] = Left([CURRENT FIELD NAME],Len([CURRENT FIELD NAME])-3);

run the query)
May 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Sugapablo | last post by:
I know how to read a text file in ASP, I know how to append lines to a text file. How do I simply erase all lines from a text file? -- http://www.sugapablo.com <--music ]
1
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then...
19
by: Eva | last post by:
Hi, I'm really really really new to javascripts and so i couldn't really comprehend thoroughly on the the previous posts regarding this issue. Anyways, I'm setting up a picture album site....
0
by: Aaron | last post by:
Hello, I have the first part of the this task done. 13 text boxes and their data in a "databin" that is a textbox. The coding was not too hard--this next part is. I have 7 more textboxes...
2
by: Rachel | last post by:
Hi All: I am having a problem with visual studio automatically erasing my code. I thought it was a fluke at first, but it KEEPS HAPPENING. I have a string variable for a data connection that I...
11
by: eeykay | last post by:
Hello, I am facing a starnge problem while erasing the last member in a vector. I am using VC++ .NET 2002 complier. I have vector of CComPtr<..> (irrelevant here), and then I iterate over the...
5
by: ma740988 | last post by:
For starters, Happy New Year to all!! I created a vector of pairs where pair first is a primitive and pair second is a vector of ints. So now: # include <iostream> # include <vector>
3
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
I'm drawing text using the DrawString method. I need a way to go back and erase one or more characters. As a first thought it seemed that one way to do it would be to go back to the character(s)...
4
by: BibI | last post by:
Hi there, I just started programming with PERL and am trying to put together my first little data manipulation program. I am working on a MAC with OSX. I have a data file with the following...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.