•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 426,568 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,632 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1261 | Replies: 3
![]() |
•
•
Join Date: May 2005
Posts: 6
Reputation:
Rep Power: 0
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:
Rep Power: 0
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
Location: Dallas, TX
Posts: 481
Reputation:
Rep Power: 4
Solved Threads: 19
why are you treating quantity like it is a text field?
try this
try this
rsResults.Source = "SELECT ProductID, SKU, ProductName FROM Products WHERE Quantity <= " +rsResults__var1
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net access ajax asp avatar backup breach code combo custom daniweb data data protection database design developer development dom dropdownlist feed government hacker ibm ip medicine microshaft microsoft module ms msdn net news normalization office reader reuse security server skin software sql survey theme vista weather web xml xoap
- Writing to an Access Database (Visual Basic 4 / 5 / 6)
- 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)
- 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


Linear Mode