order by in vb code
Posted on 2004-10-19
i have code in vb like this(table is in sql 2000 )
sql = ""
sql = "Select p.Field1,p.Field2 "
sql = sql & " from table1 as p," _
& " table2 as te" _
& " Where te.ID = p.ID" _
& " and p.id ='" _
& " order by p.Field1 DESC,p.Field2 "
if i comment order by i get the recordset but i want it in descending order by field1. why do i get an empty recordset? please can someone help me answer this problem?