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 |
sr_aneesh
Starting Member
17 Posts |
Posted - 2005-12-17 : 04:35:37
|
I have two Tables Customer and VisitI want to display the next 4 visit Dates Against Each CustomerCustomer Table ID Customer1 1 Customer1 2 Customer2 3 Customer3 4 Customer4 5 Customer5 6 Customer6 Visit Table CustomerId VisitDate3 12/15/20054 12/10/20052 12/22/20053 12/22/20051 12/22/20053 12/29/20052 12/25/2005 Which should Display as (Following are dummy data)Customer Name Visit1 Visit2 Visit3 Visit4Customer 1 12/15/2005 12/18/2005 12/21/2005 12/24/2005 Customer 2 12/13/2005 12/16/2005 12/25/2005 Customer 3 12/14/2005 12/20/2005 Customer 4 12/16/2005 12/19/2005 12/26/2005 Customer 5 12/19/2005 12/22/2005 Customer 6 12/6/2005 12/18/2005 Customer 7 12/25/2005 12/26/2005 12/28/2005 12/29/2005 Thanx in Advance |
|
activecrypt
Posting Yak Master
165 Posts |
Posted - 2005-12-17 : 05:42:34
|
Hi,add 3 days (as you said its 3 days) in visit1 then visit2 and as on , use dateadd function then:-)RegardsAndy DavisActivecrypt Team--------------------------------------------SQL Server Encryption Softwarehttp://www.activecrypt.com |
|
|
|
|
|