Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sarblota
Starting Member
8 Posts |
Posted - 2009-05-01 : 05:05:46
|
HiI have a transaction table that shows all payments on a policy and when they occurred.From this table I can construct a query that shows me the following:POLICY NO, 'EFFECTIVE FROM DATE', 'EFFECTIVE TO DATE', DESCRIPTIVE INFORMATION.The effective from and to dates I've created such that if I have transactions on Date1 and Date2 the query returns:POLICY NO, Date1, Date2 - 1, DESCRIPTIVE INFORMATION.POLICY NO, Date2, NULL, descriptive information.What I'm struggling with is that if Date2 spans over the year end I want to return a row set such as the below:POLICYNO, Date1, 31/12/2008, descriptive info,POLICYNO, 1/1/2009, Date2 -1, descriptive info,POLICYNO, Date2, NULLHope that makes sense!cheerscheersSarb Lota |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-01 : 05:12:50
|
There exists a topic here named "splitting over midnight".Search that topic since it is the same basic idea.Instead of midnight, you split over a year. E 12°55'05.63"N 56°04'39.26" |
|
|
sarblota
Starting Member
8 Posts |
Posted - 2009-05-08 : 05:09:38
|
Thanks for the info. Very helpful and solved my problem.cheerscheersSarb Lota |
|
|
|
|
|
|
|