使用 SQL select 和 JET 格式化结果

发布于 2024-08-09 04:55:28 字数 490 浏览 4 评论 0原文

我使用 MS JET OLEDB 提供程序提取 Excel 文件中的数据。我的选择结果被传递到一个组件中,我无法更改该组件来动态生成 HTML 表。我的一些数据文件包含需要用逗号 (#,###) 格式化的数字。正如我所说,我无法更改输出组件来为我格式化字符串。有没有办法可以在 select 语句期间格式化结果?

我尝试了很多不同的方法,但没有任何效果。

这是一个选择我需要格式化注册的示例...

select
[SCHOOL NAME],
[ENROLLMENT],
[STUDENT / TEACHER RATIO]
from [Public School Districts$]
where [ENROLLMENT]<>null

任何帮助将不胜感激!

I have data in Excel files that I am pulling out using the MS JET OLEDB provider. The results of my select are being passed into a component that I cannot change to generate an HTML table on the fly. Some of my data files contain numbers that I need formatted with commas (#,###). As I said I cannot change the output component to format the string for me. Is there a way I can format my results during my select statement?

I have tried a bunch of different things but nothing has worked.

Here is an example select where I need to format enrollment...

select
[SCHOOL NAME],
[ENROLLMENT],
[STUDENT / TEACHER RATIO]
from [Public School Districts$]
where [ENROLLMENT]<>null

Any help would be greatly appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゃ人海孤独症 2024-08-16 04:55:28

现在无法尝试这个,但类似的东西

FORMAT( [ENROLLMENT], '#,###')

应该可以解决问题。

有一些标准格式可以帮助您实现国际化,但可能无法满足您的需求。只需谷歌格式访问即可。

Can't try this out right now, but something like

FORMAT( [ENROLLMENT], '#,###')

should do the trick.

There are a few standard formats that would help you internationalization, but may not give you exactly what you want. Just google Format Access.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文