473,322 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Counting the occurence of a string ...

Hi ...
I have a weblog database where I want to count the occurences of a
table of string values that appear in all the urls viewed.

My tblWebLog as a field that contains the url ...
tblWebLog.[cs-uri-stem]

I have another table ... tblStrings ... that has a field [strSearch]
for a string value and an integer field [intViewCount] to count the
occurence of the string in tblWebLog.[cs-uri-stem]

I've been trying ...

Update tblStrings
Set [intViewCount] = (Select Count(*) From tblWebLog Where
[cs-uri-stem] Like '%_' + tblStrings.[strSearch] + '.htm%')

.... but it doesn't fly and I'm stumped. Any thoughts?

Cheers.

Aug 27 '06 #1
2 1954
DaFerg (da**@myalarm.com) writes:
I have a weblog database where I want to count the occurences of a
table of string values that appear in all the urls viewed.

My tblWebLog as a field that contains the url ...
tblWebLog.[cs-uri-stem]

I have another table ... tblStrings ... that has a field [strSearch]
for a string value and an integer field [intViewCount] to count the
occurence of the string in tblWebLog.[cs-uri-stem]

I've been trying ...

Update tblStrings
Set [intViewCount] = (Select Count(*) From tblWebLog Where
[cs-uri-stem] Like '%_' + tblStrings.[strSearch] + '.htm%')

... but it doesn't fly and I'm stumped. Any thoughts?
Your query make sense in relation to your description, but then again I
may be misunderstanding something.

For this sort of question, it helps if you post:

o CREATE TABLE statements for your tables.
o INSERT statements with sample data.
o The desired result given the sample.

This helps to clarify what you are looking for, and it makes it possible
to copy and paste and develop a tested solution.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 27 '06 #2
If tblStrings.[strSearch] is defined as fixed length (char) instead of
varying length (varchar) that would cause problems. Or if trailing
blanks were stored in a varchar column. Try using
RTRIM(tblStrings.[strSearch]) instead.

Roy Harvey
Beacon Falls, CT

On 27 Aug 2006 01:00:04 -0700, "DaFerg" <da**@myalarm.comwrote:
>Hi ...
I have a weblog database where I want to count the occurences of a
table of string values that appear in all the urls viewed.

My tblWebLog as a field that contains the url ...
tblWebLog.[cs-uri-stem]

I have another table ... tblStrings ... that has a field [strSearch]
for a string value and an integer field [intViewCount] to count the
occurence of the string in tblWebLog.[cs-uri-stem]

I've been trying ...

Update tblStrings
Set [intViewCount] = (Select Count(*) From tblWebLog Where
[cs-uri-stem] Like '%_' + tblStrings.[strSearch] + '.htm%')

... but it doesn't fly and I'm stumped. Any thoughts?

Cheers.
Aug 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tesla | last post by:
Hey guys, I have a string like "lalala: djkahsd : dajkdassd : adasd :" Is there a function to find the position of the "I"th occurence of a character/string? Like lets say I want to find out...
1
by: Roland | last post by:
hi all having designed my schema to use repeating groups of elements, I found that some applications (eg. Microsoft InfoPath) refused to recognised that element as a repeating element. I...
1
by: Gary Cobden | last post by:
Hi I have a routine that uses VBA to open a hidden occurence of Excel, and do background computations. However, in the event that the routine terminates abnormally, I have not been able to...
10
by: Sean Berry | last post by:
I need to find the second to last occurence of a "." in a string. Basically I am taking a URL like http://this.is.mydomin.com/path/to/file.txt and want to extract /path/to/file.txt I...
44
by: Michael McGarry | last post by:
Hi, Is there a standard library function that counts the number of occurences of a character in a string? Regards, Michael
3
by: utab | last post by:
Dear all, I tried to solve the occurence problem: to find the distinct occurences of a word in an input. I know that I could use map and other STD lib functions. I tried to do it the hard way. I...
4
by: fhmm | last post by:
I am an intermediate programmer and i tried to solve the following programme but with no success the programme is a simple text analyzer that read an input file and cumpute the occurence and...
2
by: gauravguleria | last post by:
wht's the program which takes two strings using command line arguments and finds the occurence of second string in the first string.The program should return the starting position of first...
3
by: lilly07 | last post by:
I am trying open a text file, and find the occurence of first column string (ie) $v in a separate file which contains only one column. my code is as follows but somehow it doesn't seem to count...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.