![]() |
|
|
|||||||
![]() |
MCSD - Building SQL for Numeric Value in Text Field |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 =?Utf-8?B?U29mdFNwb3Q=?= |
|
|
|
|
#2 |
|
Posts: n/a
|
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...b;en-us;221343 WKidd "SoftSpot" <> wrote in message news:AD82373B-E871-4A3F-A6EE-... > 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 > |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Prerequisites 70-745 (Business Intelligence) | Valmont | MCITP | 3 | 06-24-2008 03:03 PM |
| Problem with focus on text field and submit button | mahesh557 | Software | 0 | 05-23-2008 06:18 AM |
| Problem with focus on text field and submit button | mahesh557 | Software | 0 | 05-23-2008 06:14 AM |
| MCITP SQL Server 2005 or SQL Server 2008 | Darrilgibson@gmail.com | MCITP | 0 | 12-19-2007 01:56 PM |
| Burn process failed - help! Log file posted for help troubleshooting | Michael Mason | DVD Video | 1 | 08-16-2004 09:24 PM |