|
|
FAQ
Search
Memberlist
Usergroups
Register
Profile
Private messages
Log in
|
|
| Author |
Message |
SoftSpot Guest
|
Posted: Sat Sep 18, 2004 7:30 am Post subject: Building SQL for Numeric Value in Text Field |
|
|
I have a Text field inside MSAccess that may contain either numeric, or
alphanumeric values. Am trying to create an SQL statement to search on that
field, however sometimes the criteria provided will be numeric, sometimes
not. Tried using the following statement: (spaces exaggerate for clarity)
strWhere = strWhere & strFldName & "= ' " & CStr(vTextA) & " ' "
However an error is raised if vTextA is Numeric. Then I set up |
|
| Back to top |
|
 |
|
|
Guest
|
Posted: Sat Sep 18, 2004 4:30 pm Post subject: Re: Building SQL for Numeric Value in Text Field |
|
|
What is the error and is the error occurring on this specific line? CStr()
should convert any alpha-numeric value to a string, including empty text
values. One thing that can trip it up is Null values. Perhaps the issue is
coverting null values to a string. Look into the IsNull() function.
http://support.microsoft.com/default.aspx?scid=kb;en-us;221343
WKidd
"SoftSpot" <SoftSpot@discussions.microsoft.com> wrote in message
news:AD82373B-E871-4A3F-A6EE-97C132A54CDE@microsoft.com...
| Quote: | I have a Text field inside MSAccess that may contain either numeric, or
alphanumeric values. Am trying to create an SQL statement to search on
that
field, however sometimes the criteria provided will be numeric, sometimes
not. Tried using the following statement: (spaces exaggerate for clarity)
strWhere = strWhere & strFldName & "= ' " & CStr(vTextA) & " ' "
However an error is raised if vTextA is Numeric. Then I set up
|
|
|
| Back to top |
|
 |
|
|