Viewing 15 posts - 3,886 through 3,900 (of 5,504 total)
I would do it in three steps:
step 1: build an intermediate table with preaggregated values
step 2: do the quirky update
step 3: display the pivoted data using crossTab
Something like this (side...
March 31, 2010 at 12:16 pm
Based on your description and ready to use sample data it was really easy to work on and to match your desired result.
This is one of the very best formats...
March 30, 2010 at 3:26 pm
Something like this? (The trick is to assign a number to each row per Region and use this new column to group the data, thus eliminating the null values).
SELECT
MAX(ISNULL(pvt.[Region...
March 30, 2010 at 3:04 pm
poratips (3/30/2010)
Thanks so much for your help!
When i alter to add columns as datatime datatype and update my both the columns, can you show me how to make date...
March 30, 2010 at 2:29 pm
Hi Chandru,
select @l_identity=@@identity
will only return the last row and not all rows. You'd need to use the OUTPUT clause together with an intermediate table. See the code snippet below.
Please note...
March 30, 2010 at 10:47 am
The Dixie Flatline (3/29/2010)
It's not so bad, Lutz.ROW_NUMBER() + Tally table + CASE expression = powerful dynamic SQL. 😀
...
I'd love to agree but, unfortunately, the...
March 30, 2010 at 10:16 am
Right now we're just guessing regarding her(his?) identity.
As long as there is no proof that we're talking about the same person I'm not going to make such an assumption.
It might...
March 29, 2010 at 5:23 pm
Just being curious: How close is that particular behavior of that specific person to be qualified as being a Troll? (disclaimer: limited to that particular thread due to the lack...
March 29, 2010 at 5:09 pm
Did you try to search for "delete duplicate rows" on this site (using the search box on the upper right corner of this site).
You probably will find this link as...
March 29, 2010 at 11:25 am
Without seeing two rows (one that passed and one that failed) it's almost impossible to say what's causing the error...
March 26, 2010 at 11:42 am
Ughh!
That's going to be quite a bit of work...
Do you have any chance to either use SS2K5 or above or at least get the Date values numbered for each...
March 26, 2010 at 10:30 am
orca (3/26/2010)
Sorry, my workstation I has SQL 2008 express installed, but the server is SQL 2000 (I'm not testing against real data).
So, on what version do you want to use...
March 26, 2010 at 7:47 am
orca (3/26/2010)
Thank you. I don't fully understand what's happening, but when I run the query it creates one column for all followups, and I need one column for each followup...
That's...
March 26, 2010 at 4:54 am
ALTER TABLE [dbo].[SSTrackTime] ADD Start_datetime DATETIME
ALTER TABLE [dbo].[SSTrackTime] ADD Stop_datetime DATETIME
GO
UPDATE [dbo].[SSTrackTime]
SET
start_datetime = CASE WHEN ISDATE(START)=1 THEN START ELSE CAST(START AS XML).value('xs:dateTime(.[1])', 'datetime') END,
stop_datetime =...
March 25, 2010 at 4:33 pm
instead of
CASE WHEN client_ind = 'Y'
THEN picklist1ms AS CaseType
ELSE '' AS CaseType
END
it needs to be
CASE WHEN client_ind = 'Y'
THEN picklist1ms
ELSE ''
END AS CaseType
Edit: ... just like...
March 25, 2010 at 2:54 pm
Viewing 15 posts - 3,886 through 3,900 (of 5,504 total)