如何在excel中更新查询结果? [英] How to update the query result in excel ?

查看:180
本文介绍了如何在excel中更新查询结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过VBA中的SQL查询从MS访问MS MS中导入了一些数据。现在我想通过用0替换空单元来更新该数据(在excel中)。有没有办法使用相同的查询?



我尝试过:



我用vba代码尝试了这个。有用。但有没有办法在同一个查询中做到这一点??

解决方案

是的,它可能:



  SELECT  IIF(ISNULL([yourField]), 0 , [yourField]) AS  SomeField 
FROM [tableName];





如需了解更多信息,请参阅:

MS Access:IsNull函数 [ ^ ]

MS Access:iif Function [ ^ ]


I have imported some data from MS access to MS excel through SQL query in VBA. Now I want to update that data(In excel) by replacing empty cells with "0". Is there any way to do that using the same query??

What I have tried:

I have tried this using vba code. it works. But is there any way to do it in the same query??

解决方案

Yes, it's possible:

SELECT IIF(ISNULL([yourField]), 0, [yourField]) AS SomeField
FROM [tableName];



For further information, please see:
MS Access: IsNull Function[^]
MS Access: iif Function[^]


这篇关于如何在excel中更新查询结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆