Just append an 'AND' clause to the statement. If you're getting the style from a web page form you'll need to build the sql string in code
Code:
'SQL
SELECT P.Name,
P.Title
FROM Products P
WHERE DATEDIFF("d", P.DateReceived, Now) <= 7
AND P.style = 'dance'
'In asp it'd look something like this
strStyle = Request.Form("style")
strStyle = Replace(strStyle, "'", "''")
strSQL = "SELECT P.Name, " & _
"P.Title " & _
"FROM Products P " & _
"WHERE DATEDIFF("d", P.DateReceived, Now) <= 7 " & _
"AND P.style = '" & strStyle & "'"
'2nd query modified (I hadn't changed 'date' to "d")
SELECT *
FROM Products
WHERE (DATEDIFF("d", DateReleased, Now) >= 7
AND DATEDIFF("d", DateReleased, Now) <= 30)
Bookmarks