|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Using substr() in my SQL statement on ASP
Good day!
I'm having an error like this: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] Undefined function 'substr' in expression. on my statement: set rs1=db.execute("Select * from lecnatl where substr(natdp,1,2)='"&a_natdp&"'") Thanks for accommodating ![]() |
|
#2
|
||||
|
||||
|
I'm not sure Access supports the substr() function. Even if the function worked though, I don't think your WHERE clause is right. The syntax is
Code:
SELECT columnname from tablename WHERE columnname operator value Unless the first 2 letters of field "natdp" are the name of a column, I don't think it will work. If substr() doesn't work, you could try left()
__________________
--Dave-- U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM= |
|
#3
|
|||
|
|||
|
Thanks Dave, I'll try it and update you.
|
|
#4
|
|||
|
|||
|
Hi Dave,
You're right! Substr() doesn't work in SQL on ASP. I tried the Left() and its work. Thanks again. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Using substr() in my SQL statement on ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|