Query (1 Viewer)

trackdaychamp

Access Guy
Local time
Today, 14:37
Joined
Jan 22, 2007
Messages
26
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

AWF VIP
Local time
Today, 14:37
Joined
Jul 22, 2004
Messages
1,649
this should do it

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

trackdaychamp

Access Guy
Local time
Today, 14:37
Joined
Jan 22, 2007
Messages
26
Thanks

Your help is much appreciated!

Mark
 

Users who are viewing this thread

Top Bottom