Source language: Translate to:

Sorting a table from SQL statement

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Sorting a table from SQL statement

Postby carlos torres » Thu Jul 26, 2007 3:37 pm


I made a query as
Code: Select all
SetVar "[strSQL]" "select * from student where Group= [#34][grp][#34] ORDER BY [#34]LastName=ASC[#34]"
dbpExecSQL "Db" "[strSQL]" "Temp1"
...///dbp accept also this sintax
...///SetVar "[strSQL]" "select * from student where Group= [#34][grp][#34] ORDER BY [#34]db.rsstudent.LastName=ASC[#34]"

It works but the temporal table is not sorted, after that I had to use
Code: Select all
dbpSort "Db" "temp1" "LastName=ASC"

to see it sorted by last names

My questions are:
- is there a bug on dbp w/ the sql statetment?
- i'm doing something wrong?


Carlos t
User avatar
carlos torres
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Postby Gaev » Thu Jul 26, 2007 4:08 pm

Carlos t:

Instead of LastName=ASC try LastName ASC.
User avatar
Posts: 3757
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby christian » Sat Jul 28, 2007 3:36 am

... you only have to use "order by" without ASC. By the way: There is a different behaviour of sorting fields using MS SQL-Server 2005 versus postgreSQL, especialy using capital letters like "Meier", "meier", strange, test it. For that reason we are testing our programs on both SQL-databases. There are a lot of other "small" differences, one belongs to date, time (MS don't know them!) and datetime.
What type of SQL-Server do you use?
User avatar
Posts: 39
Joined: Sat Apr 02, 2005 9:25 am
Location: Germany

Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest