Viewing 15 posts - 8,971 through 8,985 (of 10,144 total)
Peso (1/7/2009)
See http://weblogs.sqlteam.com/peterl/archive/2008/05/13/Lightning-fast-collapsed-date-ranges-and-missing-date-ranges.aspx
Excellent article, thanks Peter.
January 7, 2009 at 4:35 am
Using the "running totals" method to take care of gaps...
[font="Courier New"]SET DATEFORMAT DMY
GO
WITH testData(Start, [Stop] , v1, v2, ID )
AS
(
SELECT CAST('01/01/09' AS DATETIME), CAST('31/01/09' AS DATETIME), 1399, 2499, 729275 UNION
SELECT...
January 7, 2009 at 4:15 am
The first start datetime and the last stop datetime in one row, for each ID?
January 7, 2009 at 2:55 am
Anu, a good first step would be to tidy up the original query. Check this against your original, it's much simpler - and therefore easier to work with, and should...
January 7, 2009 at 2:30 am
pat (1/6/2009)
it is only doing to one worksheet then!!
Nah...IF (EXISTS (SELECT fname FROM testtable WHERE fname = @Testname AND day = @day))
January 6, 2009 at 2:23 pm
The day number would be ideal, why don't you use that instead of @Testname?
January 6, 2009 at 1:50 pm
pat (1/6/2009)
then how will i write the insert and update please guide me!!thanks
Sure! Remember that PRINT statement? Post what gets printed, say the first 10 lines for one worksheet.
January 6, 2009 at 1:36 pm
pat (1/6/2009)
what?
@Testname is assigned only outside the WHILE loop (WHILE @currentRow <= @dataEndRow) so remains static for each iteration.
This conditional ...IF (EXISTS (SELECT fname FROM testtable WHERE fname = @Testname))
...
January 6, 2009 at 1:09 pm
Yes, it does. Is it always the same?
IF (EXISTS (SELECT fname FROM testtable WHERE fname = @Testname))
BEGIN
...
January 6, 2009 at 12:46 pm
pat (1/6/2009)
no i does on insert but rest of them update like if worksheet has data till 24 rows it will run update till 24 but insert is one only!!
The...
January 6, 2009 at 12:20 pm
pat (1/6/2009)
Hi,i did that already and that's why i said that it only does one insert per worksheet(total count of worksheets are 29) and it updates the same reocords.
thanks
Pat
So it...
January 6, 2009 at 12:01 pm
pat (1/6/2009)
I only does one insert and rest of them update. and file has 29 worksheet so i get...
January 6, 2009 at 11:51 am
pat (1/6/2009)
i am blank now what do i need to do and how?
Try this for starters IF (EXISTS...
January 6, 2009 at 11:35 am
pat (1/6/2009)
also if i do only insert statement it work like charm....
January 6, 2009 at 11:00 am
Viewing 15 posts - 8,971 through 8,985 (of 10,144 total)