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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: shauns1
  • Content: Threads
  • Order by date
  1. shauns1

    I think Inner Join problem

    I am Selecting all of the rows from a main table (cms_WhatsHot) along with related rows from other tables (cms_Segments and cms_SegmentsParents) all joined using Inner join. The main table (cms_WhatsHot) will always have rows, the joined tables may have no related rows. The result is that if a...
  2. shauns1

    Using Views or 'WITH' to query a query.

    Hi I have, what has turned out to be a bit of a monster stored proc. The idea behind it was so that I have just one proc that can handle many different types on my table of contacts. This table links to various other 'relationship' tables such as ContactsToDirectories, ContactsToMaillists. So...
  3. shauns1

    Compare a field to a variable in one table whilst querying another

    Hi I hope the title explained the problem accurately. I didn't quite know the best way to describe the problem. Basically, I am retrieving data from my contacts table using a stored procedure. The procedure is passed one parameter - '@directoryID'. For each record returned to my ASP.Net app...
  4. shauns1

    Can you append an auto number field to a query?

    Hi Im would like to know if its possible to create an auto number field to a query so that no matter what your query returns, you'll always have a column starting at 1 and incrementing up for each record. Example Query: Select Top 10 TeamScore From tblTeams Order By TeamScore How would I add...
  5. shauns1

    Getting access to retrieve different random records on each request

    <script runat="server"> Public objConn as new OleDbConnection (System.Configuration.ConfigurationSettings.AppSettings("ConnectionString")) Sub GetTeam(s as Object, E as EventArgs) Dim objCmd As New OleDbCommand("SELECT TOP 4 PlayerID FROM tblPlayers WHERE PositionID='defender' ORDER BY...
  6. shauns1

    Problem getting random records

    Hi, I am trying to fill a DataGrid with random records from my database. It thought I had found a way to randomly select records using SQL. So I built a stored procedure in Access and sure enough, it returns a random set of records and works exactly how I need it to. But... Whe I tried to call...
  7. shauns1

    Problem with Join and Count in the same query

    Hi I have the following query: SELECT ft.FantasyTeamID, ft.TeamName, fp.FantasyTeamPlayerID, p.PlayerName, p.PositionID FROM tblFantasyTeams AS ft, tblFantasyTeamPlayers AS fp, tblPlayers AS p, tblGoals as g WHERE p.PlayerID = fp.PlayerID AND fp.FantasyTeamID = ft.FantasyTeamID AND...
  8. shauns1

    Killer Query

    Hi I'm hoping someone could give me a hand with what seems to be an impossible task. I have a table of website hits. Each record contains the following: HitID CreationDate IPAddress DevelopmentID All are self explainatory apart from DevelopmentID. Basically, the site is a portal that leads...
  9. shauns1

    Dynamic Variables

    Hi Is it possible to target a variable, whose name you create from the content of other variables? Please stay with me on this one as I'm getting little feedback from the ASP.NET world. I'm assuming I'm not explaining it well enough. Example: I have some variables, for arguments sake lets call...
  10. shauns1

    Understanding Group By

    Hi Before I start, this is the structure of my table, tblStatsSessions. SessionID (primary key, auto number) CreationDate (DateTime) DevelopmentID (Number) The purpose of the function below(a stored procedure in Access) is to return a Count of SessionID's for the past 7 days and group them...
  11. shauns1

    Problem with Count

    Hi I'm getting confused with my joins in this query. I have a table holding: viewID SessionID developmentID There will be multiple viewID's for every developmentID and SessionID. How can I count the number of different sessionID's for a specific DevelopmentID? I am using the following, but...
  12. shauns1

    How many records can a table hold?

    Hi, does anyone know the limit to the number of records an Access table can hold? And at what point efficiency goes out the window? I'm currently logging page views in a table and wondering if this is wise / the best way to do it?? Cheers Shaun
  13. shauns1

    Problem with Date Function

    I have a query that works fine: SELECT tblPFTopics.DevelopmentID, Count(*) as TotalDev FROM tblPFEntries, tblPFTopics, tblPFThreads WHERE tblPFTopics.TopicID =tblPFThreads.TopicID AND tblPFThreads.ThreadID=tblPFEntries.ThreadID Group By tblPFTopics.DevelopmentID Until I add: AND...
  14. shauns1

    Using MAX with COUNT

    Hi This is what I'm trying to do: Select Name From tblDevelopments Where DevelopmentID = Max( SELECT tblPFTopics.DevelopmentID, Count(*) as TotalDev FROM tblPFEntries, tblPFTopics, tblPFThreads WHERE tblPFTopics.TopicID =tblPFThreads.TopicID AND tblPFThreads.ThreadID=tblPFEntries.ThreadID...
  15. shauns1

    Using Count and Max in the same query

    Hi Here is the structure of my tblSessions: SessionID (auto number) DevelopmentID (number) CreationDate (DateTime) Is there a query that would count all of the sessions for each development and return the DevelopmentID that has the highest number of Sessions. Similarly, I would like to be...
  16. shauns1

    Incrementing the value of a field

    Hi I have a table of PDF Files that can be downloaded from the server. I have a field named downloads that will store the number of times the file is downloaded. At the moment, I retreive the value of downloads, increment it within my web page and insert the new value back into the database...
  17. shauns1

    Compare to previous record

    Hi What is the correct way to compare a new record with the one before it. Basically, I have a table that stores web page names. Before adding another page name to the table, I want to check that the last one entered isn't the same page. If it is, the page name doesn't get entered again. Is...
  18. shauns1

    Using the %LIKE% operator

    Hi I have a simple search field in my form. I am trying to use it to search for a string within my 'Keywords' column. I am using this at the moment: SELECT DevelopmentID, Name, Town FROM tblDevelopments WHERE Keywords Like %@Keyword%' AND Live=Yes ORDER BY Name; but it return nothing and...
  19. shauns1

    Syntax Error with Inner Joins

    Hi Does anyone know why I'm getting the following error with the Query below? Syntax Error (Missing Operator) in query expression 'e ON e.ThreadID=t.ThreadID INNER JOIN tblUsers AS u ON u.UserID=t.CreatorID' The query is: SELECT t.ThreadID,t.Thread, t.CreationDate...
  20. shauns1

    Syntax error with inner join

    Hi Can anyone tell me why the Query below receives the following error? Syntax Error (Missing Operator) in query expression 'e ON e.ThreadID=t.ThreadID INNER JOIN tblUsers AS u ON u.UserID=t.CreatorID' The query is: SELECT t.ThreadID,t.Thread, t.CreationDate, count(e.EntryID),u.Username...

Part and Inventory Search

Back
Top