Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Sorting

Status
Not open for further replies.

tekyge

Programmer
Dec 11, 2005
125
US
Below is my statement anyone know how I can get it to sort by last name record set [ProjectName]. Thanks for help

sql = "SELECT * FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("myvar1"))
rs.open sql, conn
 
did you mean...

Code:
sql = "SELECT * FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("myvar1"))& " ORDER BY [Projects].[ProjectName] ASC

-DNG

 
Thanks dot, but its givin this error

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/cs/login/fr/index.asp, line 44

sql = "SELECT * FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("myvar1")) & " ORDER BY [Projects].[ProjectName] ASC
--------------------------------------------------------------------------------------------------------------------------------^
 
That will be because you are trying to embed quotes in a string, and not finally terminating the string, Try:
Code:
sql = "SELECT * FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session([COLOR=red]"[/color]"myvar1"[COLOR=red]"[/color])) & " ORDER BY [Projects].[ProjectName] ASC[COLOR=red]"[/color]

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 

Just a small correction for our copy-and-paste friends:

Code:
sql = "SELECT * FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("myvar1")) & " ORDER BY [Projects].[ProjectName] ASC"



A smile is worth a thousand kind words. So smile, it's easy! :)
 
Thanks guys for your help works great!!
 
i just missed the quotes in the end...sorry for that...

glad its working for you...

-DNG
 
10-4 I thank all of you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top