Instr Searches
I am searching a string that look like this (21,5,15,25) using Instr().
So, if I am searching for '5', I get everything that contains a five.
If InStr("21,5,15,25", req,QuerStr("id") Then
response.write "yes"
End If
I want only the one value '5' to get found but anything that contains a 5 is found. I have tried using Cint and Int to no avail.
View Replies
ADVERTISEMENT
I have this code in a procedure, and it basically will select all the quotes from a certain 'manager' and if the date is more then 7 days, it will archive the quote (by placing a 'Y' in it)
Declare @tempDate varchar(20)
SELECT @tempDate = DATEDIFF(day, SaveDate, getdate())
FROM QuoteFeedBack
WHERE TerritoryManager = @Manager and Archive <> 'Y' and QuoteNumber = '3'
if (@tempDate > 7)
UPDATE QuoteFeedBack Set Archive = 'Y'
WHERE TerritoryManager = @Manager and Archive <> 'Y' and QuoteNumber = '3'
Now this code works, but instead of specifying the QuoteNumber, I want it to scan through all the records for that manager. Basically searching all the quotenumbers that have not been archive yet.
View Replies
View Related
I've created a search page that gets complete addresses based on postcodes, and name, suburb and address.Almost 6000 entries in the db.I want to limit the amount of times a user can search, i tried cookies but anyone can delete cookies and off they go again.The reason behind this is to prevent the opposition from collecting stuff and cold calling them.
View Replies
View Related
I was told by a friend that Web searches like Yahoo can't "find" ASP pages to return their results within a search. Is that true?
View Replies
View Related
I've got a catalog (table) of products (records), which will undoubtedly grow to over 5000 records in months. This is in an Access 2000 mdb file behind an ASP page, and the products have full text descriptions. I want my customer to easily "search" the database
table with a simple SQL query. I guess I'll use a LIKE operator to search the field with the product's long description.
Problem: Noise words. i.e. - and, but, it, its, or, the... will return thousands of records and slow down browsing efficiency.
Has anyone got a good solution to easily eliminate noise words from submitted text entered into the asp page "search" field?
I was able to find the file noise.enu from the Microsoft Index server installation. It has about 50 words or so. Would I use a replace() function to eliminate the words from my sql statement?
I'm sure someone else has come across this.
What would be the BEST and most logical way of using VBscript and ASP to accept the query string typed and then condition it for introduction into a "LIKE" statement in an ADO query?
View Replies
View Related
Why does this code Code:
Dim mytext
mytext = "Tristique, sed tamen typicus amet, bene quia feugait eu. "
Response.Write Instr(mytext, "tamen")
Gives the response "16"? Surely this word only appears once? Is it counting letters? How can I make it identify just words?
View Replies
View Related
How do I use InStr to find the string d="1"
I have tryed:
InStr(text,"d="1"") and it does not work
I have tryed a few other variations and I cant get it to work.
View Replies
View Related
I dont want those Disp selected from access db...I am getting an error..How will I do that ?
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "49, 50"]'
/drv_sch/Generate_Sch.asp, line 55
----------------------------------------
Driver_id is a number...Disp variable has these data "49, 50, 51"
SELECT * FROM schedule WHERE not instr('Disp',driver_id)
View Replies
View Related
I have a field name "tracks" of string data type that has multiple names in it (for example: calder delaware$ aqueduct ), and I want to check to see if this certain field has "delaware$" in it. InStr or the Mid functions return the numerical order of where that string starts inside the string, but it doesnt tell me if "delaware$" exists in "tracks".
View Replies
View Related
was the instr() in asp means... meaning - why it is used.
View Replies
View Related
Using MySQL as a DB, I'm generating an OTF SQL statement that looks for matches in a comma delimited string. The code ends up looking something like this: Code:
View Replies
View Related
I am having a problem with the following code:
<%
If Len(TestRS.Fields.Item("Testimonial").value) > 150 Then
Response.Write(Left(TestRS.Fields.Item("Testimonial").Value,150)&""... <br><font size=1><a href=""/Testimonials.asp"">Read More</a></font>")
Else
Response.Write(TestRS.Fields.Item("Testimonial").Value)
End If
%>
I am getting a null response from TestRS.Fields.Item("Tesimonial").Value after it is processed by the Len function.
I am getting the following result: Quote: "... Read More This tells me that the len function is analysing the string to be greater than 150 charachters yet the string is not being expressed.
View Replies
View Related
Which is better practice?
Code:
Select * From groups Where groupName LIKE '%bli%' AND cusType LIKE 'CUST%'
or
Code:
Select * From groups Where InStr(groupName,'li')>0 AND InStr(cusType,'CUST')=1
Right now I'm using and Access database but plan to upsize to a MSSQL if that makes any difference. Are there any advantages or disadvantages to either technique?
View Replies
View Related
Just used this code and noticed it doesn't always work, turns out InStr is case sensitive.What's thet best way to do a non-case sensitive search?pHP Code:
IF INSTR(VideoName,"HiRes") THEN
View Replies
View Related
I've been given a large database of "model numbers". based on these model number I have to do something different. example model numbers:
B2020-SG1
B2020-SG4440
B2020-LG3
B2020-LG33E
B2020-SG1-SG1
B2020-SG1TD9-SG1
B2020-SG1TD15-SG4440
Basically, the first number (B2020, which could be a number of different numbers) is the model. the second and/or third number is what I have to act on. The problem is, how do I pull that third number? Especially if its the same as the first number. right now I'm using Instr(variable1, "SG1") to pull each different set of numebrs. but that only finds the first occurence. what about the 2nd? how can I find that?
View Replies
View Related
My question is
I use:
-----------------------------
dim strText,pos
strText = "This is a test!!"
pos = Instr(strText,"a",1)
response.write pos
-----------------------------
and i get:
Type mismatch: '[string: "This is a test!!"]'
What's going on?
View Replies
View Related
I'm having some trouble with an error that is thrown when I use InStr() and Mid() with a database search query. In point form:
I am retrieving an array strings from my database where the query is case insensitive. This is good.
Then I locate the keyword in the string using InStr() which is case sensitive. This is not desireable as it doesn't recognize all instances of the keyword.
I use the Mid() function to give me a portion of the string starting at the location provided by InStr() which is sometimes the number zero which in turn throws the error.
View Replies
View Related
I have a string --> 7,8,9,10. This string may contain more or less than 4 numbers.
I want to separate each number and run an sql query for each number.
for example:
select * from table1 where code = '7'
select * from table1 where code ='8'
and etc....
Can I do this in a loop?
View Replies
View Related
I get this error melding >>>Invalid procedure call or argument: 'InStr' and this is the code where this error refers to:
If (InStr(r, UCase(strRetVal), "<TABLE>") > 0) AND _(InStr(r, UCase(strRetVal), "<TABLE>") < _
InStr(r, UCase(strRetVal), "</TD>")) then ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal),"<TABLE>")- StartCellText )
Else
ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal), "</TD>")- StartCellText )
End If
in this area i am doing something, can anyone plz direct me and tell whats wrong?
View Replies
View Related
I have a variable - a large string of text - called row1. Im using VBscript to parse this row for useful information that I need. The row1 starts off as follows:
bSlip('SO','3664746','','abc','',0)>abc</a></td><td class=o>;</
Im using the position of the bSlip ---- Instr(row1, "bSlip(") to find out where the bSlip text starts and this works fine. The next few lines of text are supposed to use the position of the ">" character and the "<" character to extract the text in between. Code:
View Replies
View Related
I want to use the instr function, but return results from it depending on surtain functions, I can't realy explain so I'll show my example:
I have a string in wich some word I want to find might be in diffrent Capital Letters order, I want the Instr function to return all the values of the place of that word (avcourse I'll run a for and increase the starting point of the Instr func until it returns 0). The instinct thought is to use the Lcase or the Ucase functions, but in this case I don't know how to use them. In the same Idea I wanted to use the Instr Func with the trim Func, But Its realy the same principle if I just understood how to do so.
View Replies
View Related