I am having some trouble applying extended queries in an ASP environment. I'd like to use the following:
I've tried using the following but can't figure out how to do the case statement:
...heres where i get completely stuck!!
With my limited knowledge of ASP and SQL I'm really not sure how to go about incorporating this kind of query into ASP. THanks in advance!
Code:
SELECT Name, alphaOrder =
CASE
WHEN (LEFT(Name,2) LIKE '[a-d]') THEN 1
WHEN (LEFT(Name,2) LIKE '[b-c]') THEN 2
ELSE 0
END
FROM table
ORDER BY AlphaOrder, Name
Code:
stDQ = "SELECT * FROM table
With my limited knowledge of ASP and SQL I'm really not sure how to go about incorporating this kind of query into ASP. THanks in advance!