Viewing 15 posts - 16 through 30 (of 89 total)
Hi Guys, thank you so much for your replies, I will start using them.
Jonathan looks like he has the solution for me!
Joe I've little experience with...
August 24, 2018 at 4:23 pm
Thats all true,
But I find a simple example is best when demonstrating/explaining complex functionality such as recursion etc.
Thanks Again guys
August 9, 2016 at 9:41 am
Hi David,
That is exactly what I was looking for...
I wonder tho can it be done recursively!
kind regards
August 9, 2016 at 7:14 am
Hi Dixie,
Thanks for that, I am sure there are a number of alternative ways to solve the problem and I am always interested in looking and understanding other ways.
I was...
August 9, 2016 at 2:15 am
Hi,
My original question was along the lines of I have a table that has three columns
Table Sales (HHArea, WeekEnding, SalesAmount)
There are 6 area's with 52 weeks of sales for...
August 8, 2016 at 12:58 pm
Hi,
My original question was along the lines of I have a table that has three columns
Table Sales (HHArea, WeekEnding, SalesAmount)
There are 6 area's with 52 weeks of sales for...
August 8, 2016 at 12:57 pm
Hi Jacob ,
Tried it out and its nearly there.
Here the test data I've been using
INSERT INTO [TblClientPOCV2]
([ClientID],[StartDate],[ApptTime],[Duration],[Frequency],[EndDate],[StaffID])
VALUES
(2528,'04/01/2016','09:00',20,1,'29/01/2016', 123),
(2528,'04/01/2016','10:00',30,2,'29/01/2016', 123),
(1111,'04/01/2016','10:00',35,3,'29/01/2016', 123),
(2528,'10/01/2106','17:00',15,2,'31/01/2106', 123),
It correctly processes the first three row, but...
January 12, 2016 at 2:10 pm
Hi Jacob, you are correct in your thinking.
The output from your sample data would be...
222, '2016-01-07','13:00',30,222
222, '2016-01-14','13:00',30,222
222, '2016-01-21','13:00',30,222
222, '2016-01-29','13:00',30,222
222, '2016-01-08','13:00',30,222
222, '2016-01-22','13:00',30,222
Also max days between dates will be 28.
Hope this...
January 12, 2016 at 12:31 pm
Hi Jacob, thanks for your interest, I did leave out the PK on my initial table definitions to try tokeep it as simple looking as possible.
One more correction ClientID should...
January 11, 2016 at 6:02 pm
Hi Guys, thank you so muchagain.
Apologies to Lynn I thought all ms sql server databases had default dates as 'yyyy-mm-dd', also I should have mentioned there are only 2...
January 9, 2016 at 7:21 am
Thanks guys looks good..
Tried and appears to Work Brilliant !!!!:-D:-D:-D:-D
January 8, 2016 at 12:32 pm
HI,
Here is the new test data in the correct format.
INSERT INTO [TblAppointments]
([ClientID],[ApptDate],[ApptTime],[StaffID],[Duration])
VALUES
(2528,'10/01/2016','10:00',22011063, 30),
(2528,'11/01/2016','10:00',22011063, 30),
(2528,'12/01/2016','10:00',22011063, 30),
(2528,'13/01/2016','10:00',22011063, 30),
(2528,'14/01/2016','10:00',22011063, 30),
(2528,'15/01/2016','10:00',22011063, 30),
(2528,'16/01/2016','10:00',22011063, 30),
(2528,'17/01/2016','10:00',22011063, 30),
(2528,'10/01/2016','15:00',22011063, 45),
(2528,'12/01/2016','15:00',22011063, 45),
(2528,'13/01/2016','15:00',22011063, 45),
(2528,'14/01/2016','15:00',22011063, 45),
(2528,'15/01/2016','15:00',22011063, 45),
(2528,'16/01/2016','15:00',22011063, 45),
(2528,'17/01/2016','15:00',22011063, 45),
(2528,'10/01/2016','10:00',22016486, 30),
(2528,'11/01/2016','10:00',22016486, 30),
(2528,'12/01/2016','10:00',22016486, 30),
(2528,'13/01/2016','10:00',22016486,...
January 8, 2016 at 2:53 am
Hi Folks;
Jeffs code ran brilliantly until changed my test data and added two appointment rows for the same client with same date and times data but with different StaffID's.
The result...
January 7, 2016 at 9:51 am
Hi Hugo,
Your right, but every row from the source table could and will have different dates , therefor I need to use a cursor to iterate over them! Which...
January 7, 2016 at 7:28 am
Viewing 15 posts - 16 through 30 (of 89 total)