Julian,
> CountNewDocs (Records=1, Time=0ms)
> SQL =
> SELECT COUNT(*) AS TOTAL
> FROM dbo.DOCS
> WHERE ((CATEGORY = '')
> AND (DATEUPDATED > DATEADD(MONTH, -1 , GETDATE())))
>
Are you sure that GetDocCategories isn't returning a row where the category
is blank?
You are getting a row returned by the query, so its entirely possible that
there is a document category of "".
There were a couple of little errors in your code, nothing major, just
misplaced tags and an s missing off of attributes.category. I've also stuck
a set of double quotes around the display of the category, so if there is a
blank category you'll still be able to see it.
<CFLOOP query="GetDocCategories">
<LI class="litem">
<CFOUTPUT>
<A href="index.cfm?fuseaction=viewcatdocs&cat=#GetDocCategories.CATEGORY#">
"#GetDocCategories.CATEGORY#"
</A>
</CFOUTPUT>
<CFSET attributes.category = GetDocCategories.CATEGORY>
<CFINCLUDE template="/myfuse/qry_docscat.cfm">
<CFOUTPUT query="CountNewDocs">
#CountNewDocs.TOTAL#
</CFOUTPUT>
</CFLOOP>
Incidently, possibly another way to do this would be to get and display all
the information at once rather than hitting the database for every category.
Here is a query that might work for your database:
SELECT Category, Count(Category) AS Total
FROM dbo.DOCS
WHERE (DATEUPDATED > DATEADD(MONTH, -1 , GETDATE()))
GROUP BY Shop_Category.Shop_Category_Name;
Regards
Stephen
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.