用变量替换字段名称(SQL) [英] Replace Field Name with Variable (SQL)

查看:184
本文介绍了用变量替换字段名称(SQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我目前的程序中,我的字符串变量''ConfirmRate'',

在我的sql部分如下所示,我需要替换 VATrate (选择部分)使用ConfirmRate,我不知道该怎么做。

您的帮助表示赞赏。

in my current procedure, I have string variable ''ConfirmRate'',
in my sql section shown below, I need to replace the VATrate (select section) with ConfirmRate, I don''t know how to do that.
your help is appreciated.

展开 | 选择 | 换行 | 行号

推荐答案

我认为你需要更具体,我不确定你的问题是什么,我的第一反应就是试试这个:

I think you need to be more specific, I''m not sure what your problem is, my first reaction would be to try this:

展开 | 选择 | Wrap | 行号


感谢AJ的快速回复。你正沿着我期待的方向努力。我厌倦了修改,但它没有用。


在我的全功能应用程序中,创建订单时,VATrate会根据创建日期来应用。 />
如果以后,同一个客户重复订单,我会简单地复制它,包括增值税税率。

但是,最近在英国,已经有一些增值税变更。

所以现在我希望复制订单,但应用复制日期适用的增值税税率。目前的增值税率是''ConfirmRate''


我希望这次我能更好地解释自己。
Thank you AJ for your prompt response. You are working along the lines I am expecting. I tired the modification but it did not work.

In my fully working application, when an order is created, VATrate is applied to it according to the date period it was created.
if at a later date, the same customer repeats the order, I simpy duplicate it, including the VAT rate.
However, recently in the UK, there have been some VAT changes.
so now I wish to duplicate the order but apply the VAT rate applicable on the date period of duplication. current vat rate is ''ConfirmRate''

I hope I have explained myself better this time.


AJ'的反应似乎很好我,假设需要一个数值。


否则,请说明需要哪种类型的变量。


如果这不是问题也许您可以发布您尝试但发现失败的代码的相关摘录。我只能假设这是造成问题的其他原因。

请详细说明任何错误。
AJ''s response seems fine to me, assuming a numeric value is required.

Otherwise, please state which type of variable is required.

If this is not the problem perhaps you can post the relevant extract of the code that you''ve tried but have found to fail. I can only assume it''s something else causing the problem.

Please include a clear explanation of any error.


这篇关于用变量替换字段名称(SQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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