VB6 sql syntax

May 24, 2005 at 04:23:31
Specs: winxp pro sp2, 386mb ram p3 733

Ok i need to use the "ORDER BY" key word in sql and vb6, please can someone tell me the syntax for it, thanks ant

See More: VB6 sql syntax

Report •

May 24, 2005 at 06:07:02

Order by should be the last part of an SQL statment followed by the field name or field names you wish to order by.

"SELECT * from " & FileName & " WHERE DDate = " & dbldate - 1 & " ORDER BY ddate,dtime"

In this instance the records are first ordered by date and then time. Order by defaults to ascending order. Preceding the field names with - reverses the order and orders by descending order.

If you type ORDER BY into any code space in VB, highlight it and press F1 it will take you straight to the help files detailing more information about Order By.

The same goes for any aspect of VB. Just try highlighting SELECT and pressing F1. You will be amazed. This assumes of course that you do have the VB Help files correctly installed.


Report •
Related Solutions

Ask Question