将sql server查询转换为ms访问查询 [英] Convert sql server query to ms access query
本文介绍了将sql server查询转换为ms访问查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想将sql查询转换为ms access兼容。
SQL查询
声明 @myVar int = 0;
update tbl_Project
SET @ myvar = project_Id = @ myVar + 1
任何帮助都会非常感谢。
Kishore R
解决方案
你可以从ms-access和你链接sql server可以访问所有表和查询。如果您愿意,您甚至可以编写自己的查询。
VBA:
使用 DMax [ ^ ]函数。
Dim i 作为 整数
i = DMax( FieldName, TableName)+1
SQL:
使用Max()togheter与 Nz [ ^ ]方法或 Iif [ ^ ]替换的函数Null
,默认值。
SELECT Nz(MAX(FieldName),< span class =code-digit> 0 )+1 As [MaxPlusOne]
FROM TableName
如需了解更多信息,请参阅:
使用新的表达式生成器在Access 2010应用程序中构建If-Then语句 [ ^ ]
Hi all,
I want to convert an sql query to ms access compatible.
SQL Query
Declare @myVar int=0;
update tbl_Project
SET @myvar = project_Id = @myVar + 1
Any help will be very much thankfull.
Kishore R
解决方案
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.
VBA:
Use DMax[^] function.
Dim i As Integer i = DMax("FieldName","TableName") +1
SQL:
Use Max() togheter with Nz[^] method or Iif[^] function to replaceNull
with default value.
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[^]
这篇关于将sql server查询转换为ms访问查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文