View Full Version : Query


trackdaychamp
02-08-2007, 03:08 AM
Hi,

I have a table called Strategic Programmes which has 2 columns "ProgNo" (unique ID) and "ProgName"

I need to connect to SQL Server from Access using connection and recordset objects to find the next highest "ProgNo"

What is the SQL query I need to execute to find the next highest ID number and how do I extract this from my recordset?

Thanks,

Mark

Dennisk
02-08-2007, 06:54 AM
this should do it

SELECT MAX([progNo]) + 1 as NextNum FROM [Strategic Programmes]

trackdaychamp
02-08-2007, 07:14 AM
Your help is much appreciated!

Mark