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 strongm 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: *

  1. shauns1

    I think Inner Join problem

    Bingo! Thanks mate.
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. shauns1

    Getting access to retrieve different random records on each request

    I think I've worked it out using Random() Dim r as New Random() Dim intRan intRan = r.Next(1000) Dim objCmd As New OleDbCommand("SELECT TOP 4 PlayerID, Rnd(" & -1 * (intRan) & "*PlayerID) FROM tblPlayers WHERE PositionID='defender' ORDER BY Rnd(" & -1 * (intRan) & "*PlayerID)", objConn)...
  7. shauns1

    Problem getting random records

    I think I've worked it out using Random() Dim r as New Random() Dim intRan intRan = r.Next(1000) Dim objCmd As New OleDbCommand("SELECT TOP 4 PlayerID, Rnd(" & -1 * (intRan) & "*PlayerID) FROM tblPlayers WHERE PositionID='defender' ORDER BY Rnd(" & -1 * (intRan) & "*PlayerID)", objConn)...
  8. shauns1

    Getting access to retrieve different random records on each request

    Hi Both of these options still result in the same set of records being returned every time! Unless my datagrid is telling me porkies as that's the only thing I've got displaying the records. But as it stands, everytime I click that button, there is no change in the records. I have tested the...
  9. shauns1

    Getting access to retrieve different random records on each request

    Hi Doesn't myLong + 1 just = 1? Or am I mixing up Long with integer? Thanks - just trying to understand whats going on.
  10. 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...
  11. shauns1

    Problem getting random records

    OK, error above was due to incorrectly declaring Random(). I code the code to work but it still returns the same set of data. How do I change the seed that Access uses to create the Random from with my .Net page?! Many thanks Shaun
  12. shauns1

    Problem getting random records

    PHV, this didn't seem to make any difference. It still returned the same set of records. Wouldn't the above code always result in IngCounter being '1'? Woja - Your post does make sense but I'm struggling to implement your solution. I have tried to do a combination of both solutions... Public...
  13. 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...
  14. shauns1

    Problem with Join and Count in the same query

    Oh right, I see. Thanks for the clarification.
  15. shauns1

    Problem with Join and Count in the same query

    I see. But was 'NZ' just a variable name?
  16. shauns1

    Problem with Join and Count in the same query

    Golom - job done. Thank you. Can I just ask where 'NZ' comes from. I get lost in the query at that point. Is it just a variable name? Plus it helps so mucg when you layout the query this way. I didn't realise access allowed this. Many thanks
  17. 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...
  18. shauns1

    Killer Query

    You make it look sooo easy. I think this does the job for now. I will work with it over the next few days to test. Many thanks for your help! Shaun
  19. 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...

Part and Inventory Search

Back
Top