Not sorting

rowSel = dbJHGCGC.SelectSQL( "SELECT * FROM tblGiftCertsUsed WHERE custRecNum=?", strCustName, " ORDER BY customerName ASC" )

This isn’t sorting as expected so I suspect my syntax is incorrect…

You need to include the entire SQL in the first parameter and the variable with the value to use in the 2nd parameter.

Try something like this:

Var sql As String
Var rowsel As RowSet
sql = "SELECT * FROM tblGiftCertsUsed WHERE custRecNum = ? ORDER BY customerName ASC"
rowSel = dbJHGCGC.SelectSQL( sql , strCustName )
2 Likes

What is „as expected“? For SQLite use ORDER BY lower(customerName) ASC.

u are using 2 parameters at SelectSQL but only one “?”
if you want that order by as parameter then it should look like
rowSel = dbJHGCGC.SelectSQL( "SELECT * FROM tblGiftCertsUsed WHERE custRecNum=? ?", strCustName, " ORDER BY customerName ASC" )

Thanks, I’ll give this a run now…