Belopw is the sql code I use to show a report the report loops via a function in the page that shows the results of the code below. All I need is for it to sort those results via lastname but not put the last name first Tarwn is right I am try to find the last space in the name as a starting point. If I could do want Tarwn was tring to do it would be perfect.
dim conn, rs, sql, intTelephone, intMobile
set rs = Server.CreateObject ("ADODB.Recordset")
Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Data\Data.mdb;" & _
"Jet OLEDB:System Database=C:\Data\Scur.mdw", _
"xxx", "xxxxxxxx"
sql = "SELECT * FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("cs_1")) & " order by Mid(ProjectName, Len(ProjectName)-InStr(ProjectName, ' ')) ASC