473,503 Members | 5,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem to find record between perticular value

27 New Member
hi all,
I wanna find record in between particular range of value.

e.g. i want to find all the records whose RBI is between 10 to 50
my query is,
query = "select * from Offense where RBI= (select RBI from Offense where RBI between "+rbiv1+" and "+rbiv2+" and FirstName <>'"+str1+"' and LastName <>'"+str2+"')";

sub query return null,due to which I can't get the resulting records.

Please tell me what is the mistake in this query.

How to write query to access value between two ranges?


Thanks
vikas
Mar 9 '09 #1
2 2136
debasisdas
8,127 Recognized Expert Expert
try using the following

query = "select * from Offense where RBI in (select RBI from Offense where RBI between "+rbiv1+" and "+rbiv2+" and FirstName <>'"+str1+"')" and LastName <>'"+str2+"'";
Mar 9 '09 #2
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Without "IN"

query = "Select * from Offense where RBI between " + rbiv1 + " and " + rbiv2 + " and FirstName <> '" + str1 + "' and LastName <> '" + str2 + "'";

Regards
Veena
Mar 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3517
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
2
2070
by: Douglas Buchanan | last post by:
This is a mystery! Why does the boolean value of a record change without my input. What follows describes the situation and the behavior. Table1: Field1: Text Field2: Yes/No Form1 has two...
6
27677
by: gauravkhanna | last post by:
import java.io.*; class Automation1 implements Runnable { int iterationCount=0; Thread t; FileReader fr; //FileWriter fw; BufferedReader br; ...
9
9666
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
22
4290
by: b_r | last post by:
Hi, I'm trying to make a simple operation (insert into DB) in VB 2005 and SQL Server. The code is as follows: Dim sConnectionString As String = _ "Data...
9
5741
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
3
2447
by: Shailja | last post by:
Hello, I have serious problem with VSFlexGrid. I am explaining my problem : I have VSFlexGrid in my form. VSFlexGrid consists of data ie. It is filled with data. It has 9 columns. When I click...
1
1315
by: narayast | last post by:
Hi I wann find out the size of the AUD_LOG table in the ADW schema...how can i find the size of that table in that perticular schema.. thanks Satish
2
2994
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.