Go Back   Velocity Reviews > Newsgroups > MCSD
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

MCSD - Building SQL for Numeric Value in Text Field

 
Thread Tools Search this Thread
Old 09-18-2004, 08:19 AM   #1
Default 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



=?Utf-8?B?U29mdFNwb3Q=?=
  Reply With Quote
Old 09-18-2004, 04:45 PM   #2
 
Posts: n/a
Default 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...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
>





  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46