Viewing 15 posts - 541 through 555 (of 668 total)
not sure why you're using a CTE. You can just use a simple select and group by. One of the issues you're having is because you are gouping...
July 7, 2010 at 11:51 am
You can use a CTE. This assumes that an employee can not exist in a specific load, so that won't count against the totals. See Employee 345. ...
July 7, 2010 at 11:38 am
I assume that en employee could exist in one load and not in the next (lunch break, etc.). If this is the case, then what would the calculation be...
July 7, 2010 at 11:03 am
Is there a way to distinguish the different loads? What do you mean by an employee had 25 seconds, then 30 seconds? Do you have any sample tables...
July 7, 2010 at 10:35 am
You could do a quirky update. Something like this, although I had to add a clustered index on ModelID and ClientID desc to get the update to work. ...
July 7, 2010 at 10:32 am
I think this is what you are looking for
create tables
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#orders','U') IS NOT NULL
DROP TABLE #orders
--===== Create the test table with
CREATE...
July 7, 2010 at 9:42 am
How about table layouts, sample data and expected results?
July 7, 2010 at 8:29 am
just add a where clause to the end of it
declare @Temp TABLE ([DATE] VARCHAR(12), CODE CHAR(1))
INSERT INTO @Temp ([DATE], CODE)
SELECT 'June', 'A' UNION ALL...
July 2, 2010 at 6:20 am
Pat,
if you do decide to change the datatype in the tables and you are using SQL Server 2005 or higher, you could try the new datatype vardecimal. This works...
July 1, 2010 at 2:09 pm
just a couple of things I noticed. First, it is not very efficient to run the query with the 4-part naming convention. You should investigate using OpenQuery instead....
July 1, 2010 at 1:35 pm
how many actions can a tranid have? why do they have to separated into different columns? how will the table be queried (where action1 = 'ABCD' or action2...
July 1, 2010 at 12:30 pm
a pivot table should work for you. Try this
declare @test-2 table(
[tran_id] [nvarchar](14) NULL,
...
July 1, 2010 at 12:21 pm
I'll reply on the main thread instead of this one
July 1, 2010 at 12:20 pm
again, I don't know what you are expecting for results. I can keep posting tables of what I think you expect, but if you don't tell me, I can...
July 1, 2010 at 10:22 am
I still don't understand what you are looking for for results. Is it
ISBN Status
30955619911373
30955619911363
30955619911343
30955619911333
30955619911323
30955619911313
30955619911306
because that is the highest status the function...
July 1, 2010 at 9:57 am
Viewing 15 posts - 541 through 555 (of 668 total)