Excel:在“命令文本"中发送多个值 [英] Excel: Send multiple values in "Command text"

查看:118
本文介绍了Excel:在“命令文本"中发送多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

位于数据>连接>属性>定义(选项卡)>命令文本"中,我具有以下内容:

Located in the "Data > Connections > Properties > Definition (tab) > Command text", I have the following:

{Call SP_calculo_algo(?)}

当前该函数仅通过其唯一参数接收一个值,有人告诉我说它由问号(?)字符表示.

Where currently the function receives only one value through the unique parameter that it has, that according with someone told me it is represented by the character of the question mark (?).

我需要通过该函数发送两(2)个值,因为我有SQL查询,该查询返回的数据引用了两个日期之间的范围.例如:开始日期(参数1)和结束日期(参数2).

What I need is to send two (2) values through the function, since I have the SQL query that returns data that refer to a range between two dates. For example: Start Date (parameter 1) and End Date (parameter 2).

你能帮我吗?

推荐答案

确保您使用Microsoft Query进行连接.

Make sure you are using Microsoft Query for your connection.

数据->从其他来源->从Microsoft Query

Data -> From Other Sources -> From Microsoft Query

在向导的末尾,请确保指定将数据返回到Microsoft Excel".

At the end of the Wizard, make sure you specify "Return data to Microsoft Excel".

执行查询后,数据将在您的工作表上.单击结果集上的某个位置,然后选择查询数据->连接->属性.

After the query executes, the data will be on your worksheet. Click somewhere on the result set, then select the query Data -> Connections -> Properties.

单击定义"选项卡.修改命令文本,以将带有问号的查询作为参数的占位符.

Click on the definition tab. Modify the command text to include the query with question marks as placeholders for your parameters.

单击确定",系统将提示您输入每个参数.如果要保存输入的值以供将来刷新,请单击该框.

Click OK, and you will be prompted for each parameter. Click the box if you want to save the value you enter for future refreshes.

这篇关于Excel:在“命令文本"中发送多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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