By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.