Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing the values between strings

Status
Not open for further replies.

abyinsydney

Programmer
Feb 17, 2004
99
AU
greetings Fellow citizens

I need to write a query to find parameters between two strings

for instance find all the values between system and operator

Do i have to convert these strings in to ASCII Representation and then wrtie a query to find the value between these integer values

Could any one throw light on this issue
 
Hi Aby,

I am sorry, I wasn't able to understand your question properly. I can try to put them in differnt words.

Cheers,
Venu
 
An example may help aswell, with perhaps some pseudo-code ...
 
greetings sedj and venu

here it goes

suppose i have two strings

string 1 =System
String 2= System

these strings are stored in a colum in the DATABASE

I need to find the values between these strings.Understand it this way need to find the values between ttwo dates instead of dates i need to find the values between two strings

how to i find the values between two strings

aby
 
What values ?! What is the variable System ?
 
It sounds like you are looking to do some sort of range sorting?

You have two options:

A) Based on your DBMS you can use DB specific sql to handle this

B) Handle it in java.

Either way you will have to write variable type specific code to handle this. For example, when ranging dates with mysql you'll be able to use DATE_ADD etc etc. In java you would have to implement Comparable interfaces that know how to do date math. This would be different for int type,s string types etc.

So I do not see a generic 'one size fits all' solution. Based on your DBMS you may want to let the DB handle this or if you want cross DBMS compatibility you will want to do it with Comparable interfaces.
 
greetings siberianyour query is very complex

mine is a simple problem


how do i ind the value between two strings

Select * FROM financial_transactions_archive_extract
WHERE financial_transactions_archive_extract.account_no = '188S12' AND financial_transactions_archive_extract.date_transaction
BETWEEN 'system1' && 'system'


system 1 and system are braches

processing branch --system1
retrival branch ---system2

there are two strings

any idea
 
I guess I don't understand what you wanted to do. First you said you wanted to compare strings and then you hinted at needing to compare dates.

If you need to compare dates use your DBMS specific date routines.

If your trying to do ranged values on strings you'll need to do that in code, most DMBS do not have ranged string operations.
 
greetings siberian

dates and string comparison are thwo different subjects
 
Correct, this is why my comment addresses both independantly.

referring to strings
Code:
If you need to compare dates use your DBMS specific date routines.

referring to dates
Code:
If your trying to do ranged values on strings you'll need to do that in code, most DMBS do not have ranged string operations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top