Format Number Within Text String

Oct 19, 2006

hi
I'm no expert and can't seem to find what i'm looking for.

i have data i enter into a text box. the data might be in the format

"name"
OR
"name, date, age"
OR
"name, date"

if on the second or third example above i entered the data like shown below how would i VB code the afterupdate to do this:

turn
David Roberts, 12122006
to
David Roberts, 12/12/2006

OR turn
David Roberts, 12122006, 56
to
David Roberts, 12/12/2006, aged 56

any ideas??
I'm working along the lines of instr, mid, etc. but i'm not sure of the correct procedure
thanks in advance

View Replies


ADVERTISEMENT

Modules & VBA :: Unable To Convert String Into Double Number Format

Jan 31, 2014

I have been trying to convert string into double number format. I am running a SQL query in VBA that returns a double number format; however my understanding with SQL queries in VBA is that they return string only. The results are showing up perfectly fine when I run the query in the query editor; however when I try using the returned value in further calculations in VBA I keep getting a "Type Mismatch" error.

View 7 Replies View Related

General :: Convert Text String To Date Format

Apr 10, 2013

I am connecting acces to oracle servers via ODBC .

In the table there is a date time stamp - format data type text:

20130225060621

I would like to convert so that it is recognised as a date so I can calculate against e.g. Now() or another standard date format.

this is what I am currently using (which is OK) BUT I need to calculate against the time also.

Current Check Point Date: CDate(Mid([DZ_ZPKT_AK],7,2) & "/" & Mid([DZ_ZPKT_AK],5,2) & "/" & Mid([DZ_ZPKT_AK],1,4))

I spoke to an IT guy who works in TOAD program and he gave me this SQL:

select to_date(dz_zpkt_ak,'DD/MM/YYYY HH24:MI:SS')from orders where ordnr='4411310';

this is the format I would like but cant make this work.

View 12 Replies View Related

Formating Number Within Text String

Oct 6, 2006

looked around but could not find the answer.
i have a text box that might or might not contain text and number data. an example of the data in the text box might be;

bob roberts, 17/03/2006, aged 23

what i would like is some VB code that would:

check anywhere in the text box for number characters that are 8 characters in length with a comma at the end [12345678,] as in the first example. and change this to 12/34/5678,

bob roberts, 17032006, aged 23
would become 'on lost focus'
bob roberts, 17/03/2006, aged 23

anybody any idea how to do this?

thanks

View 2 Replies View Related

Format A Number As A Text In A Query

Apr 5, 2007

Hello,
I have a text file I'm querying that stores a field as a text.
ComponentID:0000000242

I'm inserting this data into a table that stores this value as a number. Thus truncating the leading zeros.
ComponentID:242

I would like to create a query on the table using an InnerJoin on the text file column:ComponentID:0000000242 and the table column:ComponentID:242 as the unique identifier. Doing this join gives a case error because of the different data types.

Can format ComponentID using a query so it reads from my table as 0000000242 and do an InnerJoin to the text file. In vb
String= Format(242, "0000000000")
But I'm finding it difficult to get the query to format this correctly.

Unfortunately, i'm unable to change the column data type in the table structure and am looking for a work around. Is this even possible? Any ideas?

Thanks.

View 1 Replies View Related

Modules & VBA :: Fields In Text And Number Format - Type Mismatch In Expression

Oct 29, 2013

I have two tables in a query joined by a ID field. The problem is in the one table the ID fiels is a text format and in the other table its a number format so the query builder doesnt like that and gives me the Type mismatch in expression error.

There's no way around it though; i need it to be those formats in its respective tables for reasons i wont go into here for simplicity.

View 2 Replies View Related

Queries :: Convert Phone Number In Text Format And Remove Dashes Or Parenthesis

Aug 7, 2014

Is there a way to convert a phone number in text format into a number and remove any dashs or parenthesis. What function can I use ?

old format (951) 244-3011
new format 9512443011

View 2 Replies View Related

Number Format To General Format

May 4, 2012

I am exporting data from access 2007 to Excel 2007 using VBA code. I have a whole number, which I want displayed as whole number. But after the export, the number is using the 1000's seperator in Excel. So for example if my original number in access table is 12000, it is showing up as 12,000 in the excel file.It has something to do with the NumberFormat property. I have tried doing this but doesn't work.

objSheet.Range("A1:A7").NumberFormat = "General"

View 2 Replies View Related

Modules & VBA :: Add Currency Format To Concat String

Jan 20, 2015

I have a Concatenate string of text and currency. When joined together, the currency format disappears. I need to reformat so the string stays together with new format. Below is what I have:

Public Function ConcatAgreementFundsCommitted(ID As String) As String
'/ Purpose: Generate a concatenated string of Tracks for selected line.
On Error GoTo Err_Handler
Dim lngLen As Long 'Length of string.
Dim strOut As String 'Output string to concatenate to.

[code]....

I need 'Funds_Committed' to display as currency.

View 2 Replies View Related

How To Convert Time String To Timestamp Format

Aug 12, 2014

I have strings with hours and mins i.e "1 hour" or "7 hours 30 mins" or "10 mins". how to convert it to timestamp hh:mm so i can caclulate the totals?

View 1 Replies View Related

General :: How To Format The Text Using Format Function

Jul 7, 2015

I want to format the text using format function. how i format the word apple to "apple" (With Quatation mark).

str = Format(Me.word, xxxx)

View 3 Replies View Related

Show Text Box In A Form Based On Character Within A String In Another Text Box

Dec 21, 2012

I have a form where I want a textbox [txtMaxOrdLimit] to be visible only if another text box on the same form [PaNumber] contains the letter D in the string. This is the code I have on the forms On Current property but I'm missing something because textbox [txtMaxOrdLimit] doesn't show on the form at all.

If Me.PaNumber = "*D" Then
Me.txtMaxOrdLimit.Visible = True
Else
Me.txtMaxOrdLimit.Visible = False
End If

View 3 Replies View Related

Forms :: Changing Format Of Field Based On String Length

Jun 11, 2014

I have a continuous form that displays data from a table. What I am trying to accomplish is to change the format of the field if the string length is equal to 11, to "@@@-@@@-@@@@-@". Otherwise if it is greater or less than 11 then no format.

I have tried it using code:

If Len(Me.FormFieldName)=11 Then
Me.FormFieldName.Format = "@@@-@@@-@@@@-@"
End If

Is it even possible and if so is my syntax correct or am I way off base?

View 8 Replies View Related

Get The Number Out Of A String

Nov 19, 2007

in the query design how can I extract a number out of string. ex
25 bp
234.56 bp

etc. ? I would have expected INT(FiledName) but it's not it

View 3 Replies View Related

Convert String To Number

May 31, 2005

I have a field on my Report called Revenue. It is used in a calculation and there is a calculated field called Profit. Revenue-Cost=Profit. That all works.

The only thing that is wrong is that the Revenue field displays its numbers like this:

0.7
12.43
4.3
0

etc.

i.e. not formatted for currency. But I don't get the currency option under Format. It is based on a Query and this Query is based on a Linked Table.

Any suggestions on how to get it formatted as currency while still having the calculated field working?

View 3 Replies View Related

Generate A String From Another Number

Sep 13, 2006

i have a table where one column has numbers such as 6104003 and i would like another column to recogzie this number and make a new string in this format 61P04-003 ajacent to it. can i do that in a table or does it have to be a querie? and the bigger question is how do i do this :confused:

View 3 Replies View Related

Extract A Number From A String?

Sep 16, 2013

I do have a module to extract a number from a string :

Public Function ExtractedValue(strSent) As Double
If IsNull(strSent) Then
Exit Function
End If
Dim strTemp As String
Dim intLoop As Integer

[code]....

My problem is that the string I do have is like:

19.0 EA
195 PAC
42 M
150 L

the problem is that when the number is like 19.0 EA the value I get is 190, in reality it should be 19. The rest is fine as there are no dot's.

View 3 Replies View Related

Queries :: Convert String To Number

Dec 17, 2013

how I can convert the first column to show the number? I used the expression below, but it does not convert anything with a letter or a 0

Expr1: Val([SPPC TEST]![JULY_ACCRUAL_ADJ_X])

View 7 Replies View Related

How To Cast A String Into Integer Or A Real Number?

May 8, 2007

Iff(fico>600,1,0) as g,
I found fico is a string in access table. so the above does not work.
How to fix this problem
Thank you very much.

View 3 Replies View Related

How To Convert A String To Number Or Vice Vese?

Sep 14, 2005

Hi!

I have two tables Atable and BTable and both have a field called AcctNo. In Atable, it is type of Number and in BTable, it is type of Text. When I do a join with these two tables

select * from Atable, BTable where Atable.AcctNo=Btable.AcctNo

I get error saying "type mismatch".

My question here is: How can I convert a type from number to string or string to number in my sql statement?


Thanks,

Aijun.

View 3 Replies View Related

Queries :: Value In Query Returning As String And Not A Number

Apr 3, 2014

I have a query which runs fine, however one of the outputs is a calculated field and i use the Format(someValue,"Fixed") method of specifying the format for the % Change .Here is the query

Code:

SELECT tblTempBearsWeek3.SymbolCode AS [Short Ticker], tblTempBullsWeek3.SymbolCode AS [Long Ticker], tblTempBearsWeek3.[Week 3 Date], tblTempBearsWeek3.Short, tblTempBullsWeek3.Long, tblTempBearsWeek3.[Short Week 3 Close], tblTempBullsWeek3.[Long Week 3 Close],

[code]...

The problem is that the % Change calculated field for some reason comes out as a String. i know this because when I try and sort on that column, it sorts it as if it is text and not a number value i.e. it doesn't put it in Ascending order.

View 2 Replies View Related

Forms :: How To Cancat A String With Number Field

Jun 24, 2015

I have a table and i want to have the id of this table as :

ST_1
ST_2
ST_3

I mean ST_automatic number. I want to know how i can create it. Is it possible to set the first value of auto number field in ms access? Also it is ms a ccess web database?

View 3 Replies View Related

Queries :: Convert 19 Digit Number To Hex String

Mar 4, 2015

I need to run a query that converts a 19 digit number stored in a Short Text field to a hex string

Example of the string is "3310854670615838865" the result should look like "2DF284C801000091"

View 1 Replies View Related

Modules & VBA :: How To Find If Field Contains Number In The String

Oct 7, 2014

I am looking to find if a field contains a number and then build a case statement depending on which number is found. The field will contain data just like this:

Quote:

Repaired frequency response and grounding issues. Replaced 2 Hybrids, capacitors, and connectors. Tested MER/BER and operation to specs.

Here is my code that did not work:

Code:
If Me.txt_work_comm1 Like "*Hybrid" Then
'Sets up auto priced based on number of hybrids entered
'1 hybrid
If Me.txt_work_comm1 Like "*1" Then
strCriteria = "repair_item = 'Charter RF Amplifier Repair + 1 Hybrid' AND profile_types = 'Alpha'"

[Code]....

To Summarize:
1. I need to find if the word "Hybrid" or "Hybrids" is in the field
2. Then I need to know how many to determine a price

View 1 Replies View Related

Parsing Through A String And Counting Number Of Occurrence

Feb 12, 2013

I have about 150k rows that look like this

SHORT_DESCRIPTION
unable to view
unable to send out some stuff
what is going on

Is it possible for access to query through each field, and tell me the total number of occurence for each word? In this small example, the output would be:

Unable 2
to 2
view 1
send 1
out 1
some 1
stuff 1
what 1
is 1
going 1
on 1

Is this possible?

View 6 Replies View Related

Number Fields In Text To Number Field, Formula For Fiscal Year

Nov 26, 2004

Date of Birth (DOB) field etc. in one program are text - how do I make another file with the same data into number fields for Date of Birth field etc? When I copy data to file that has number fields the 09252004 is changed to 9252004. Can I get reports with the correct Date of Birth in them by moving data from text file to number file?

There is data entered monthly in file and formula has been set up for January, February etc as ---quarter: Int(([month]-1)/3)+1. I would like formula for the fiscal year for April to be counted as month 1, May - month 2, June as month 3, July as month 4, August as month 5, Sept as month 6, October as month 7, Nov as month 8, Dec as month 9, Jan as month 10, Feb as month 11 and March as month 12.

Thank you

View 6 Replies View Related







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