Perl - 创建查看 3 个字段的日期范围
我有 3 列数据:
Item | CreateDate | Version |
ABC | 1/1/2010 | X |
ABC | 3/15/2010 | XB |
BBB | 2/15/2010 | X |
BBB | 6/15/2010 | X |
如何填充名为“版本开始”和“版本开始”的另外两列数据?版本结束将根据 CreateDates 计算给定项目的版本开始日期和版本结束日期。
Item | CreateDate | Version | Version Start | Version End
ABC | 1/1/2010 | X | 1/1/2010 | 3/14/2010
ABC | 3/15/2010 | XB | 3/15/2010 | (04/29/2010)Today
BBB | 2/15/2010 | X | 2/15/2010 | (04/29/2010)Today
BBB | 6/15/2010 | X | 2/15/2010 | (04/29/2010)Today
I have 3 Columns of data:
Item | CreateDate | Version |
ABC | 1/1/2010 | X |
ABC | 3/15/2010 | XB |
BBB | 2/15/2010 | X |
BBB | 6/15/2010 | X |
How might I populate two additional columns of data named Version Start & Version End that would calculate the start date of the version and the end date of the version for a given Item...based on the CreateDates.
Item | CreateDate | Version | Version Start | Version End
ABC | 1/1/2010 | X | 1/1/2010 | 3/14/2010
ABC | 3/15/2010 | XB | 3/15/2010 | (04/29/2010)Today
BBB | 2/15/2010 | X | 2/15/2010 | (04/29/2010)Today
BBB | 6/15/2010 | X | 2/15/2010 | (04/29/2010)Today
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Date::Calc 的 Add_Delta_Days 函数来确定版本结束日期,假设它是版本开始日期之后的特定天数。
You can use Date::Calc's Add_Delta_Days function to determine the Version End date, assuming it is a certain number of days after the Version Start date.