November 2003 Blog Posts
Anyone know what this will return? Unfortunately, the argument must be less than or equal to 32 due to the number of levels of recursion SQL can handle. It's probably not very efficient, either. But, it's pretty cool!
As promised, here's a sample ASP report from Northwind using my ASP Report Class (http://weblogs.sqlteam.com/jeffs/posts/526.aspx).
Hopefully, everyone will agree that the script is very easy to write and read and much shorter. All grouping (for both headers and footers), subtotals and running totals are completely taken care of by using the class, and it is giving you recordset functionality (movenext and EOF and column reference by name) using the speedy GetRows() method under the hood.
For this to work, you must have the class saved as “ReportClass.asp“ in the same folder as this script (notice the include).
<%@ Language=VBScript %>
<%Option Explicit%>
<%@ Language=VBScript %>
If you use ASP, ADO and SQL Server, check out my new article. It includes code for a VBScript class which makes writing HTML reports based on an ADO recordset with group headers, footers, and subtotals extremely easy.
read more...
As some of you may know, I recommend to avoid using CASE expressions in the WHERE clause of a query to express conditional logic. I prefer to have everything translated to simple ANDs, ORs and NOTs to keep things a) portable, b) easier to read and c) efficient.