Click to See Complete Forum and Search --> : Simple Sort/ Filter Statement (if you know how)


Brian@nif2
02-14-2006, 05:04 PM
Hi guys
I'm only starting to cut my teeth in dreamweaver, and using it as the basis to try and pick up php and mysql.
I'm trying to do something which I think should be fairly straightforward, but I don't know the correct command to make it work.

In Dreamweaver, I'm trying to tell the query to Filter the record by 2 feilds, I can get it to sort the first field, but when I try and add a second field to sort it won't work, probably becuase I'm not telling it the right command, or writing it wrong

Here is the codeing that works, from the advanced recordset in Dreamwaver

SELECT *
FROM nif2_dprofiles
WHERE Formula = ''F2''
ORDER BY Number ASC

From that I want to add a second filter eg WHERE Rowb = "X"


the second thing I want to do is add a second Sort on it, so that it sorts first by Number, then by a second field, "Number2", again, how do I add this second field into my coding?

All help is greatly appreciatted.

NogDog
02-14-2006, 05:23 PM
SELECT *
FROM nif2_dprofiles
WHERE Formula = 'F2' AND Rowb = 'X'
ORDER BY Number ASC, Number2 ASC

Brian@nif2
02-17-2006, 07:34 AM
Many thanks, thats it sorted, even when I read that at First I didn't see what I'd done wrong, and then I noticed I'd double quotation marks instead of single.
Its amazing in code how something so silly can cause you to screw up.

Thansk again