SQL Server 中的货币汇率
来自墨西哥官方货币兑换网站,http://dof.gob.mx/index.php,我需要将页面最右侧的美元汇率拉入 SQL Server 2005 查询中的简单数学方程,以计算美元兑墨西哥比索的发票金额。这可能吗?如果可能的话,如何实现?
From Mexico's official currency exchange website, http://dof.gob.mx/index.php, I need to pull the USD rate on the far right of the page into a simple math equation in a SQL Server 2005 query to calculate USD to Mexican Pesos for invoices. Is this possible, and if so how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从这种 Web API 服务中提取日期会简单得多,您可以简单地计算 USD 到 MXN 的最新换算:
http://openexchangerates.org/documentation
然后将所有价格存储为 USD 或 MXN 在数据库中,并在以下情况下应用转换需要。
例如,在此汇率列表中,所有比率均与美元进行比较。因此,美元与墨西哥比索的比率现在为13.3744。因此,要将美元转换为比索,您需要将美元金额乘以汇率:
而
比索
值是:我希望这对任何人都有帮助!
It would be much simpler to pull date from this kind of web API service where you can simply calculate up-to-date conversion of USD to MXN:
http://openexchangerates.org/documentation
And then just store all prices either in USD or MXN in the database, and apply conversion when needed.
E.g. in this list of exchange rates all ratios are compared to USD. So USD to MXN ratio is now 13.3744. So to convert dollars to Peso you need to multiply amount in dollars to the exchange rate:
and
peso
value is:I hope that'll help anyone!