473,387 Members | 1,757 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,387 software developers and data experts.

How do I output field as a numeric and not string?

Hi - I have used scripts similar to the following to replace strings
in queries that output datafeeds in Excel format.

This time I need to output the field as a numeric and not a string.
What do I need to change in this script to make this happen?

Function PaypalQtyCheck(s As String, strGoAhead As String)
Dim a() As String
Dim v As Variant
If strGoAhead = "3" Then
s = Replace(s, "0", "1")
End If
a() = Split(s, "<")
For Each v In a
PaypalQtyCheck = PaypalQtyCheck & Mid$(v, InStr(v, ">") + 1)
Next v
End Function
May 3 '06 #1
2 1229
skinnybloke wrote:
This time I need to output the field as a numeric and not a string.
What do I need to change in this script to make this happen?


Just add "As Long", that will implicitly convert the value (if possible) to
numeric:
Function PaypalQtyCheck(s As String, strGoAhead As String) as Long

/jim
May 3 '06 #2
Thnaks Jim - that worked a treat.

On Wed, 3 May 2006 12:59:47 +0200, "Jim Andersen"
<jb****@politiSLET.dk.invalid> wrote:
skinnybloke wrote:
This time I need to output the field as a numeric and not a string.
What do I need to change in this script to make this happen?


Just add "As Long", that will implicitly convert the value (if possible) to
numeric:
Function PaypalQtyCheck(s As String, strGoAhead As String) as Long

/jim

May 16 '06 #3

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

Similar topics

1
by: JuniorLinn | last post by:
Hi there - I would like to share this strip of code with our SQL 2000 DBA community. The code below strips all non-numeric characters from a given string field and rebuilds the string. Very...
2
by: SQL_developer | last post by:
Hello All, I'm trying to parse for a numeric string from a column in a table. What I'm looking for is a numeric string of a fixed length of 8. The column is a comments field and can contain the...
8
by: Vladimir | last post by:
Hello, I have a table in MS Access database. It has one field (with BYTE datatype) that has several properties set in Lookup tab of table Design View. Display Control = Combo Box. Row Source...
2
by: Paulo Rodrigues | last post by:
Hi I would like some help about the following : I have a text field and I don't want it contains any numbers. How can I limit this situation ? So far, I couldn't find literature exacly...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
8
by: jchludzinski | last post by:
Is there a format specification for printf that will result in: 1000000 being printed as 1,000,000? Or 1000000.0 as 1,000,000.0? ---John
7
by: Tizzah | last post by:
What is wrong with that? regex = /^(http|https):\/\/+({1}+)*\.{2,5}(({1,5})?\/.*)?$/ if(field.hpage.value != regex.test(field.hpage.value)){ alert("Bad Homepage") field.hpage.focus()...
4
by: Rich Shepard | last post by:
I have this print statement in a function: print '%2d $%11.2f $%10.2f $%9.2f $%9.2f' %(nper, pv, diff, ten, bonus) and I would like to have the output right justified in the specified...
9
by: john coltrane | last post by:
Is there way to create a formatted string in a similar that is similar to sprintf? The same for printing, printf? C,D,E,F,G,N,X for currency, decimal, exponential, fixed, general, numerical,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.