| | |
From * Where =< in Access Database
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2005
Posts: 6
Reputation:
Solved Threads: 0
Hi,
I am really struggling to get this working. Im using an Access Database *.mdb in case that helps.
I am trying to check the database for stock levels, I would like to submit a number via a form, and have the database checked to see if the value is equal to or less than the number submitted. It should be straight forward, but I need help.
This Code works, but defeats the purpose:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity like '%" + Replace(rsResults__var1, "'", "''") + "%'"
I have also tried:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity < '%" + Replace(rsResults__var1, "'", "''") + "%'"
it doesnt work, neither does:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity =< '%" + Replace(rsResults__var1, "'", "''") + "%'"
Please stop me tearing my hair out someone.....
Joe
:cry:
I am really struggling to get this working. Im using an Access Database *.mdb in case that helps.
I am trying to check the database for stock levels, I would like to submit a number via a form, and have the database checked to see if the value is equal to or less than the number submitted. It should be straight forward, but I need help.
This Code works, but defeats the purpose:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity like '%" + Replace(rsResults__var1, "'", "''") + "%'"
I have also tried:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity < '%" + Replace(rsResults__var1, "'", "''") + "%'"
it doesnt work, neither does:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity =< '%" + Replace(rsResults__var1, "'", "''") + "%'"
Please stop me tearing my hair out someone.....
Joe
:cry:
•
•
Join Date: May 2005
Posts: 6
Reputation:
Solved Threads: 0
Just to clarify things in case they are unclear.
The first example:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity like '%" + Replace(rsResults__var1, "'", "''") + "%'"
Works in as much as it finds an exact match for the number submitted/searched for.
But the whole point is to be able to search for a number and have all the numbers that are equal to or less than it in that field found.
Even if you can help to just find the numbers that are less than the number searched for that will really help.
The first example:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity like '%" + Replace(rsResults__var1, "'", "''") + "%'"
Works in as much as it finds an exact match for the number submitted/searched for.
But the whole point is to be able to search for a number and have all the numbers that are equal to or less than it in that field found.
Even if you can help to just find the numbers that are less than the number searched for that will really help.
•
•
•
•
Originally Posted by charitiesonline
Hi,
I am really struggling to get this working. Im using an Access Database *.mdb in case that helps.
I am trying to check the database for stock levels, I would like to submit a number via a form, and have the database checked to see if the value is equal to or less than the number submitted. It should be straight forward, but I need help.
This Code works, but defeats the purpose:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity like '%" + Replace(rsResults__var1, "'", "''") + "%'"
I have also tried:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity < '%" + Replace(rsResults__var1, "'", "''") + "%'"
it doesnt work, neither does:
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity =< '%" + Replace(rsResults__var1, "'", "''") + "%'"
Please stop me tearing my hair out someone.....
Joe
:cry:
•
•
Join Date: Jul 2005
Posts: 483
Reputation:
Solved Threads: 19
why are you treating quantity like it is a text field?
try this
try this
ASP Syntax (Toggle Plain Text)
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity <= " +rsResults__var1
![]() |
Similar Threads
- VB: Connect to Access database via ODBC datasource name (Visual Basic 4 / 5 / 6)
- Running a VB application with MS Access database (Visual Basic 4 / 5 / 6)
- Writing to an Access Database (Visual Basic 4 / 5 / 6)
- Create an Access Database using Java (Java)
- Frontend HTML, Backend MS Access Database?? (Database Design)
- Writing to an Access Database using Java... (Java)
Other Threads in the ASP Forum
- Previous Thread: Getting a blank asp page
- Next Thread: Help - Wiindows
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit web webserver windows7





