Select Max not working here

J

J. Muenchbourg

I'm trying to pull the highest 'articleid' value out of an sql table,
but the below is giving me an Incorrect syntax near 'articleid' error:


dim sqlid
sqlid = "SELECT max articleid from tblarticles"
Set rsid = Server.CreateObject("ADODB.Recordset")
rsid.Open sqlid,sqlc,3


????
Muench
 
R

Ray at

Try:

select max(articleid) from tblarticle

<optional>
Then do

iHighID = sqlc.Execute(sqlid)(0).value
</optiona>

Ray at work
 
W

WIlliam Morris

You're almost right.

SELECT max(articleid) from tblarticles {note the parentheses}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top