I've been looking around various threads on this site and found a lot of useful stuff regarding querying Active Directories but I am still having problem getting my code to work.
It is not finding the username within the group when I would expect it to. I'm not sure how to find out the username...
I have been looking at replies to this sort of question but they go into a lot of detail and I am hoping that they contain a lot of stuff that I don't need as they are a bit over my head.
Basically I want my ASP page to retrieve the domain name of the Windows logon. Then if the domain is X then...
Is there a way to display a message when the mouse hovers over a row in a table? I would like the message to pop up like an alt tag. The message it displays needs to be dynamic to reflect the value that is displayed in the first column of the table.
Thank you.
Thanks Tim. It is a tricky little blighter. You are correct in assuming that there is no RecID in tblSeg, and that tblX and tblSeg are just joined according to the count of each RecID being between LowerLimit and UpperLimit.
So for example,
There are six occurances of RecID=15 in tblX so...
Basically Count(*) within:
JOIN tblSeg tbl2
ON (SELECT Count(*) FROM tblX)
BETWEEN tbl2.LowerLimit AND tbl2.UpperLimit
needs to be the same value as CountOfID, but it won't let me just replace Count(*) with CountOfID.
Thanks Tim. This is giving me 'Internal SQL error', I think this something to do with the number of subqueries.
I have done a bit of delving and it looks like the problem lies with this bit:
JOIN tblSeg tbl2
ON (SELECT Count(*) FROM tblX)
BETWEEN tbl2.LowerLimit AND tbl2.UpperLimit
it always...
Thanks James and Tim,
I have used your coding and I now have the following:
SELECT
100.0*SUM(CAST(tbl1.Star AS tinyint))/Count(*) AS Perc,
tbl1.RecID,
Count(*) AS CountOfID,
SUM(CAST(tbl1.Star AS tinyint)) AS CountOfStar,
tbl2.RankID,
(CASE WHEN 100.0*SUM(CAST(tbl1.Star AS...
I am trying to join two tables in a bit of an odd way. My tables are:
tblSeg:
RankID | SegAbbrev | LowerLimit | UpperLimit
1 | A | 6 | 100
2 | B | 3 | 5
3 | C | 0 | 2
and
tblX
RecID | Perc...
Thanks both James and Donutman. Getting rid of those brackets did the trick. I've learnt a few useful tips today! It's a good job theres some bored folk out there!
It does not seem to working it is still coming up as either 0 or 100%. My select statement now is:
SELECT 100.0*(SUM(CAST(Star AS tinyint))/Count(*)) AS Perc, RecommendedID, Count(*) AS CountOfID,
SUM(CAST(Star AS tinyint)) AS CountOfStar
FROM tblX
GROUP BY NameID
Am I doing something really...
Thanks James.
I have put in the second method and it works good.
I am now trying to create a percentage field and so I am adding this to the select statement:
(SUM(CAST(Star AS tinyint))/Count(*))*100 AS Perc
Which basically is the same as:
(CountOfStar/CountOfID)*100
It is not liking the...
I have a table that is set up as:
ID | NameID | Star (1 or 0)
1 | 1 | 0
2 | 1 | 0
3 | 1 | 1
4 | 2 | 1
5 | 2 | 1
6 | 3 | 0
I need to produce a recordset that will give me the NameID, the total occurances of the NameID and the...
I have been a bit thick here. Got it sorted now though without need of the increment. May as well just set the EntryValue as SortOrderID!
(SELECT TOP 100 percent tblEntryValue.NameID, EntryValue.EntryValue AS SortOrderID FROM tblEntryValue
WHERE tblEntryValue.HeaderID='" & SortHeader & "'
GROUP...
I have a SQL table with a field type set as varchar. Obviously this field can therefore contain either text or numbers. When retrieving data from the table I need to be able to determine if all the filtered results are numeric or whether there are alpha characters included too. I need to do...
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.