well here is the exact code i used
strSql = "select count(DIR_ID) as TotalCount"
strSql = strSql & " from (select distinct DIR_ID"
strSql = strSql & " from " & strTablePrefix & "DIRECTORY"
strSql = strSql & " inner join " & strTablePrefix & "DIRECTORYCAT"
strSql = strSql & " on " & strTablePrefix & "DIRECTORYCAT.DIRCAT_ID = " & strTablePrefix & "DIRECTORY.DIR_CATID)"
set rs = my_Conn.Execute (strSql)
if rs.eof or rs.bof then
else
Response.Write "TotalCount-" & rs("TotalCount") & "-<br>"
end if
When I do this it returns 5 which is wrong, it should be 7.
There are 4 items in the FORUM_DIRECTORYCAT and 5 in FORUM_DIRECTORY. Two of the records in FORUM_DIRECTORYCAT do not have anything related to them so therefor should not be counted. It is ok if it uses two querys I am not worried about that.
Thanks for trying Nikkol