Click here to Skip to main content
15,943,008 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I want to convert an sql query to ms access compatible.

SQL Query

SQL
Declare @myVar int=0;
update tbl_Project
SET @myvar = project_Id = @myVar + 1



Any help will be very much thankfull.




Kishore R
Posted

You can link the sql server from ms-access and you can access all the tables and queries. If you want you can even write your own query.
 
Share this answer
 
VBA:
Use DMax[^] function.
VB
Dim i As Integer

i = DMax("FieldName","TableName") +1


SQL:
Use Max() togheter with Nz[^] method or Iif[^] function to replace Null with default value.
SQL
SELECT Nz(MAX(FieldName),0) +1 As [MaxPlusOne]
FROM TableName


For further information, please see:
Using the New Expression Builder to Build If-Then Statements in Access 2010 Applications[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900