如何为每个日期记录? [英] How to place a record for each date?
问题描述
我的桌子上有这样的数据
日期金额
2013-12-02 -500
2013-12-05 100
2013-12-07 50
2013-12 -09 -20
2013-12-18 400
我的要求是
2013-12-02 -500
2013-12-03 -500
2013-12-04 -500
2013- 12-05 -400
2013-12-06 -400
2013-12-07 -350
2013-12-08 -350
2013-12-09 -370
2013-12-10 -370
2013-12-11 -370
2013-12-12 -370
2013-12-13 -370
2013-12-14 -370
2013- 12-15 -370
2013-12-16 -370
2013-12-17 -370
2013-12-18 30
(即)我需要根据上表为每个日期存入金额。
告诉我一些解决方案。
Hi,
Im having table with data like this
Date Amount
2013-12-02 -500
2013-12-05 100
2013-12-07 50
2013-12-09 -20
2013-12-18 400
My requirement is
2013-12-02 -500
2013-12-03 -500
2013-12-04 -500
2013-12-05 -400
2013-12-06 -400
2013-12-07 -350
2013-12-08 -350
2013-12-09 -370
2013-12-10 -370
2013-12-11 -370
2013-12-12 -370
2013-12-13 -370
2013-12-14 -370
2013-12-15 -370
2013-12-16 -370
2013-12-17 -370
2013-12-18 30
(ie) I need to place amount for each date based on above table.
Tell me some solutions.
推荐答案
我只是为了理智而希望表中的日期字段是日期类型或日期时间类型。
然后无事可做。数据的呈现不应该在SQL-Server上完成,而应该在客户端上完成。
在服务器上执行此操作从来没有理由,因为它会严重阻碍您引入不同的格式稍后。
让应用程序担心正确格式化日期。
问候,
- 曼弗雷德
I just hope for the sake of sanity that the date field in the table is of date type or maybe datetime type.
Then there's nothing to do. The rendering of the data should not be done on the SQL-Server, but rather on the client.
There is never a reason for doing this on the server as it will severely hinder you in introducing different formats later on.
Let the application worry about formatting the date correctly.
Regards,
— Manfred
这篇关于如何为每个日期记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!