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...
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...
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...
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...
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)...
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)...
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...
<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...
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
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...
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...
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
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.