Test amount fields to be numeric and non 0

# Thread: Test amount fields to be numeric and non 0

1. Senior Member
Join Date
Dec 1969
Posts
334

## Test amount fields to be numeric and non 0

I settted this function to check given fields to be <BR>1) all numeric<BR>2) at least one of them non zero<BR><BR>Function funAMOUNTS(WNETR2, WVATNR2, WRECV2, WBANKCHG2)<BR> If ( IsNumeric(WNETR2) is True and <BR> IsNumeric(WVATNR2) is True and <BR> IsNumeric(WRECV2) is True and<BR> IsNumeric(WBANKCHG2) is True ) and<BR> ( WNETR2 &#060;&#062; 0 OR <BR> WVATNR2 &#060;&#062; 0 OR<BR> WRECV2 &#060;&#062; 0 OR <BR> WBANKCHG2 &#060;&#062; 0 ) Then <BR> funAMOUNTS = "Y"<BR> Else<BR> funAMOUNTS = "N"<BR> End If <BR>End Function <BR><BR>I am getting an error message like "is true" within the if is incorrect. can you help me.<BR><BR>Thanks and regards,<BR><BR> Guglielmo

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: Test amount fields to be numeric and non 0

"is True"?<BR><BR>You mean "= True", surely.<BR><BR>Craig.

3. Senior Member
Join Date
Dec 1969
Posts
334

## RE: Test amount fields to be numeric and non 0

SORRY ! I have a 2 SAMS manuals (ASP and VBScript) that I found very unclear . . In fact this is the way they suggested to code but . . . in a very messy contest.<BR><BR>Thanks<BR>again.<BR><BR> Gug

4. Senior Member
Join Date
Dec 1969
Posts
334

## RE: Test amount fields to be numeric and non 0

But still does not work.<BR><BR>Hereunder is the error message <BR><BR>Microsoft VBScript compilation error &#039;800a03ea&#039; <BR><BR>Syntax error <BR><BR>/Easijet/Easijet_Process_TEST/User_csv_files/HHValidation.asp, line 566 <BR><BR>If IsNumeric(WNETR2) = True and<BR>---------------------------------^<BR><BR>and here is the last bersion of the code.<BR><BR>Function funAMOUNTS(WNETR2, WVATNR2, WRECV2, WBANKCHG2)<BR> If IsNumeric(WNETR2) = True and <BR> IsNumeric(WVATNR2) = True and <BR> IsNumeric(WRECV2) = True and<BR> IsNumeric(WBANKCHG2) = True and<BR> WNETR2 &#060;&#062; 0 OR <BR> WVATNR2 &#060;&#062; 0 OR<BR> WRECV2 &#060;&#062; 0 OR <BR> WBANKCHG2 &#060;&#062; 0 Then <BR> funAMOUNTS = "Y"<BR> Else<BR> funAMOUNTS = "N"<BR> End If <BR>End Function <BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•