Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2006

Tip: Looking for answers? Try searching our database.

Query Help - PLEASE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robby - 30 Mar 2006 06:16 GMT
I am in need of a little help.  I need to write a query to total up some
search results. Here is a same of the data.

l_id        l_include                               l_path
664         test                                  Support
665         test                                  Support
666         test                                  Support
667         test                                  www
670         visio                                Support
671         patent                              Support
672         stencil visio                      Support
676         doc tech                          Support
677         doc tech                          www
684         backpack                        Support
685         fiber panel patch              Support
686         fiber panel patch              www
687         data ps2 signal video        Support
688         c/port signals                    Support
689         doc tech                           Support

I need a query that will show the number of hits for each item under column
l_include for each of the unique paths.  So for "TEST" I would need it to
look like:

Search word        location of search        number of searches
test                            Support                        3
test                            www                            1

For "doc tech" it would look like:
doc tech                    www                            1
doc tech                    Support                        2

If you could point me in the right direction I would greatly appreciate it.

Robby
Tom Ellison - 30 Mar 2006 06:35 GMT
Dear Robby:

Sounds like:

SELECT l_include AS [Search word],
   l_path AS [location of search],
   COUNT(*) AS [number of searches]
 FROM YourTable
 GROUP BY l_include, l_path
 ORDER BY l_include, l_path

Put the actual name of YourTable in the above.

Anywhere close?

Tom Ellison

>I am in need of a little help.  I need to write a query to total up some
> search results. Here is a same of the data.
[quoted text clipped - 33 lines]
>
> Robby
Robby - 30 Mar 2006 07:12 GMT
I like it!  But I am getting the following error when I run it.

[Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, and image
data types cannot be compared or sorted, except when using IS NULL or LIKE
operator.

I got the same error when I ran my query and I thought it was the syntax of
the query.  Here is what I was running.

SELECT     l_includes, COUNT(l_includes) AS MyResults
FROM         support
WHERE     (l_path = 'support')
GROUP BY l_includes

SELECT     l_includes, COUNT(l_includes) AS MyResults
FROM         support
WHERE     (l_path = 'www')
GROUP BY l_includes

SELECT     l_includes, COUNT(l_includes) AS MyResults
FROM         support
GROUP BY l_includes

As you can see yours makes it a lot less work on me and I like that.  I
guess I have a different issue and I will need to research and see what it
is.  On my statement above it did not like
(l_path = 'www') if I changed it to (l_path LIKE 'www') like the error
message said it would work.

Robby

> Dear Robby:
>
[quoted text clipped - 50 lines]
>>
>> Robby
Tom Ellison - 30 Mar 2006 07:35 GMT
Dear Robby:

The same query should work pass-through to SQL Server and avoid these
difficulties.

Tom Ellison

>I like it!  But I am getting the following error when I run it.
>
[quoted text clipped - 82 lines]
>>>
>>> Robby
igitit69 - 29 Apr 2006 00:41 GMT
> I am in need of a little help.  I need to write a query to total up some
> search results. Here is a same of the data.
[quoted text clipped - 31 lines]
>
> Robby
igitit69 - 29 Apr 2006 00:49 GMT
yes this is igitit69 and i guess i don't gitit and i've been tring to read my
mail the last hour and i got to but couldn't open it to read i do not want
these problems and send me back to the old msn and you all can have this bull
sh.t.. its live all right.. if i had my way you should of called it DEAD..
ITS ABOUT NOTHING I CAN'T BELIEVE YOU ALL COULD COME UP WITH A NO NOTHING
PROGRAM LIKE THIS..MIKE TOLLIVER  IGITIT69 @ YAHOO.COM.. AND I MEAN THAT
.Should took my mail to yahoo  have a good day you ruin mine..

> I am in need of a little help.  I need to write a query to total up some
> search results. Here is a same of the data.
[quoted text clipped - 31 lines]
>
> Robby
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.