Axes.SelectItems() 与基于 DateTime 的查询?

发布于 2024-09-13 05:00:00 字数 329 浏览 3 评论 0原文

是否可以使用 xpath 语法进行基于日期的查询?我所研究的一切都表明这是不可能的。我正在查询一组日历,只想返回一个月的数据 - 我可以使用什么策略来实现此目的?

8/10/2010:编辑以获取更多信息

我正在构建一个通知系统,用户可以在其中获取特定事件的提醒。提醒可以提前 4 周、3 周、2 周、1 周。我将此信息存储在单独的 SQL 数据库中。

我需要执行以下两件事之一,以使我的代码尽可能高效:

  1. 从我的通知表中进行选择,然后仅返回带有与其关联的通知的事件。
  2. 仅带回 4 周的活动,然后查看哪些活动附加了通知。

Is it possible to do a date based query using xpath syntax? Everything I have researched inidicates that this is not possible. I am querying a group of calendars and only want to bring back a month's worth of data - what strategies could I use to accomplish this?

8/10/2010: Edit for more information

I am building a notification system where users can get reminders for particular events. Reminders can come 4 weeks, 3 weeks, 2 weeks, 1 week in advance. I am storing this information in separate SQL database.

I need to do one of two things to keep my code as efficient as possible:

  1. Do a select from my notifications table, then only bring back events with notifications associated with them.
  2. Only bring back 4 weeks of events and then see which have notifications attached to them.

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

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

发布评论

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

评论(1

陌若浮生 2024-09-20 05:00:00

在不了解更多信息的情况下,我想说你应该看看你的信息架构。对于日历、新闻和类似类型的内容,将项目安排在某种存档中通常是一个好方法。

Company News
- 2010
  - 01
  - 02
  ...
  - 12

等等。

甚至还有一个共享源代码项目旨在帮助您或多或少准确地维护这样的结构。查看News Mover 模块。

Without knowing more, I'd say you should be looking at your information architecture. With calendars, news and similar type content, it is most often a good approach to arrange the items in some sort of archive.

Company News
- 2010
  - 01
  - 02
  ...
  - 12

And so on.

There's even a Shared Source project designed to help you maintain more or less excactly a structure such as this. Take a look at the News Mover module.

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