Forum Replies Created

Viewing 15 posts - 16 through 30 (of 89 total)

  • RE: Dynamic Cross tab query using dates

    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...

  • RE: Viewing Transaction Log

    Thanks Sue,

    How do I do this myself?

  • RE: Table of Dates in TSQL

    Thats all true,

    But I find a simple example is best when demonstrating/explaining complex functionality such as recursion etc.

    Thanks Again guys

  • RE: Table of Dates in TSQL

    Hi David,

    That is exactly what I was looking for...

    I wonder tho can it be done recursively!

    kind regards

  • RE: Sum 4 weeks sale amount into month

    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...

  • RE: Sum 4 weeks sale amount into month

    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...

  • RE: Sum 4 weeks sale amount into month

    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...

  • RE: CURSORS Versus SETS

    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...

  • RE: CURSORS Versus SETS

    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...

  • RE: CURSORS Versus SETS

    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...

  • RE: get all dates between 2 dates 7 days apart

    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...

  • RE: Crosstab query NOT using pivot

    Thanks guys looks good..

    Tried and appears to Work Brilliant !!!!:-D:-D:-D:-D

  • RE: Crosstab query NOT using pivot

    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,...

  • RE: Crosstab query NOT using pivot

    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...

  • RE: SELECT JOIN AND INSERT QUERY

    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...

Viewing 15 posts - 16 through 30 (of 89 total)