Hello
I have the following sql-statement:
strSQL = "SELECT * FROM tblCBtest WHERE ((cb = '" & strTypen1 & "') OR (cb2 = '" & strTypen2 & "') OR (cb3 = '" & strTypen3 & "')) AND "
strSQL = strSQL & " (Amt LIKE '%" & strAmt & "%') AND "
strSQL = strSQL & " (Postnr LIKE '%" & strPostnr & "%') AND "
strSQL = strSQL & " (Byen LIKE '%" & strByen & "%') AND "
strSQL = strSQL & " (Navn LIKE '%" & strNavn & "%')"
My problem is that i want to order the output by "Navn".
Where do I put my "ORDER BY Navn" command.
I've tried to place it at the end of the SQL, but that doesn't seem to work..
What do I do wrong?
Help please
Greetings Rasmus
I have the following sql-statement:
strSQL = "SELECT * FROM tblCBtest WHERE ((cb = '" & strTypen1 & "') OR (cb2 = '" & strTypen2 & "') OR (cb3 = '" & strTypen3 & "')) AND "
strSQL = strSQL & " (Amt LIKE '%" & strAmt & "%') AND "
strSQL = strSQL & " (Postnr LIKE '%" & strPostnr & "%') AND "
strSQL = strSQL & " (Byen LIKE '%" & strByen & "%') AND "
strSQL = strSQL & " (Navn LIKE '%" & strNavn & "%')"
My problem is that i want to order the output by "Navn".
Where do I put my "ORDER BY Navn" command.
I've tried to place it at the end of the SQL, but that doesn't seem to work..
What do I do wrong?
Help please
Greetings Rasmus