If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#Error in query
Hello,
I have a table R, ID as number T as text | ID | T | | 1 | A01 | | 2 | CEE | | 3 | Z33 | if the two right characters is numeric return numeric value else the two right characters , in this example | ID | T | | 1 | 1 | | 2 | EE | | 3 | 33 | i try this query: SELECT ID, IIF(IsError(Right(T,2) *1),Right(T,2) ,Right(T,2) *1) FROM R and the query not trap the error, it is possible get this. thank's |
#2
|
|||
|
|||
#Error in query
"Carlos" wrote in message ... Hello, I have a table R, ID as number T as text | ID | T | | 1 | A01 | | 2 | CEE | | 3 | Z33 | if the two right characters is numeric return numeric value else the two right characters , in this example | ID | T | | 1 | 1 | | 2 | EE | | 3 | 33 | If the number can never be zero, try IIF(Val(Right([T], 2) = 0, Right([T], 2), Val(Right(T), 2)) However, since you're allowing a Text value to be a valid result, the field will be of Text datatype in any case. You CANNOT have a field which contains text in a Number datatype. -- John W. Vinson/MVP |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
SQL query showing diff between actual and budget | Bon | Running & Setting Up Queries | 3 | August 25th, 2005 12:07 PM |
Nested in-line Query | laura | Running & Setting Up Queries | 0 | February 11th, 2005 12:17 AM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |
Too Few Parameters error Mail Merge Access Parameter Query | Tony_VBACoder | Mailmerge | 3 | September 14th, 2004 12:15 PM |