I'm trying to build a recordset query, that returns results based on a location selected.
The location value sent to the page that processes the query is an integer, for instance -
1 = Portsmouth
2 = Southampton
3 = London
4 - Birmingham
This works fine if a variable ios sent, however the form can be submitted without a location being selected, in which case it should return results for all locations
If it were a string that was being sent, I could use the % wildcard, however I can't find a way of doing this.
I'm building the recordset using dreamweaver, which demands a default value.
My recordset currently looks like the code in the code section -
FYI 'MMColParam' references the variable && it is the line begining 'AND AD.JBALocation IN(' that i am strugling with
Any help you can offer will be gratefully appreciated -
Lower(AD.JBATitle) AS JBATitle,
FROM dbo.JBAdvert AD
WHERE JBASiteID = 30
AND AD.JBALocation IN(Select JBLocation from JBLocation where JBLID = COALESCE('MMColParam', JBLID))
ORDER BY AD.JBAID DESC