如何将时间添加到 CR 报告中的日期字段?

发布于 2024-10-03 00:37:22 字数 410 浏览 0 评论 0原文

我有几个 Crystal Reports XI Release 2 报告,它们是 COM InteropForm 应用程序的一部分,包含在 VB6 应用程序中。这两个报告都显示 SQL Server 数据库中日期时间字段中的日期。他们在过去三年左右的时间里工作得很好。

现在我的任务是显示数据的时间部分。我已在 CR 11 R 2 设计器中打开了两个 .rpt 文件,并且正在查看格式编辑器。在“日期”选项卡下,我没有看到任何显示数据日期和时间的内容。 (除非它是系统默认的长格式,但我不确定每个用户的机器上是什么。事实上,坦率地说,我不知道如何在我自己的机器上检查它,这是一个Windows安装了 SP3 的 XP Pro 机器。)无论如何,我已经查看了“自定义样式”,但我再次没有看到任何可以让我显示数据库中“日期时间”字段的时间部分的内容。如何显示数据库中日期时间字段中的日期和时间?

I've got a couple of Crystal Reports XI Release 2 reports that are part of a COM InteropForm's app, that is included in a VB6 app. Both of these reports display a date from a DateTime field in a SQL Server database. They've worked fine for the last 3 years or so.

Now I've been tasked with showing the time portion of the data. I've got both of the .rpt files opened in the CR 11 R 2 designer, and am looking at the Format Editor. Under the Date tab I don't see anything which will display both the date and time of the data. (Unless it is the System Default Long Format, but I'm not sure of what that is on each of the users' machines. In fact, frankly I don't know how to check that on my own machine, which is a Windows XP Pro machine with SP3 installed.) Anyway, I've taken a look under the Custom Style, but again I don't see anything there which will allow me to display the time portion of the DateTime field from the database. How do I display both date and time, from the DateTime field in the database?

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

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

发布评论

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

评论(2

可爱暴击 2024-10-10 00:37:22

您应该会看到很多选项。如果您的视图与所附图片类似,那么您就可以开始了。

如果您只看到一堆数字格式,则说明日期未以正确的格式存储。通过使用自定义公式将字段转换为日期时间,然后显示新的公式字段而不是原始字段,可以轻松解决此问题。

格式编辑器

You should see quite a few options. If your view looks anything like this attached picture, then you're good to go.

If you only see a bunch of formats for numbers, then the date is not stored in the correct format. This is easily fixed by making a custom formula converting the field to a datetime and then displaying that new formula field instead of the original.

Format Editor

凉城已无爱 2024-10-10 00:37:22

报告选项中有一个选项(至少对于 CR9,CR XI 中也应该有),您可以在其中选择如何处理日期时间字段 - 日期、时间或日期时间。从那里选择日期时间并重新检查您的字段格式。

警告 - 之后您无法将该值恢复为日期:)

There's one selection in Report Options (at least for CR9, should be in CR XI too), where you can choose, how to treat DateTime fields - Date, Time or DateTime. Select DateTime from there and re-check your fields formatting.

Warning - you can't revert that value to Date afterwards :)

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