Viewing 15 posts - 526 through 540 (of 683 total)
Then it appears we are still at the 'understanding your problem' part of the process. Defining a problem incompletely or ambiguously often puts people off helping, and is probably why...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
April 6, 2006 at 11:57 am
Hi Howard,
Maybe something like this? ![]()
--data
declare @t table (id int identity(1, 1), Control_Code char(1))
insert @t (Control_Code)
select '1'
union all select...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
April 6, 2006 at 9:27 am
I don't think you'll find a faster method to solve the problem you've defined. Try analysing the execution plan, and seeing if you can add indexes to speed up the...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
April 3, 2006 at 6:52 am
You don't need any looping. This query does all you need (well, all you've asked for) on its own.
Have you not run it to see? That always helps! 
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
April 3, 2006 at 2:37 am
See changes in red below. Note that (both above and here) 't' is a query which gets all the rows we want - and that we use outer joins just in...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 31, 2006 at 6:42 am
<Sigh>
I always try to use temporary objects so anyone (including me) can run the code without it messing up their database.
And all I did was correct syntax errors (e.g. "Cust_CompanyAdress,
HAVING"). I'm sure...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 30, 2006 at 7:04 am
Interesting. I ask for data. You give me code.
Well, never mind. I've corrected the syntax errors in your query, and added my sample data, and it all works as expected...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 30, 2006 at 6:44 am
BTW, the above assumes there are no more than 3 ins or 3 outs for any employee on any day. I assumed this was okay since your Report table has...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 30, 2006 at 6:25 am
This is what I got from your question... ![]()
--data
if Object_ID(N'TempDB.[dbo].[#AccessLog]') is not null drop table #AccessLog
CREATE TABLE [dbo].[#AccessLog] (
[RCDID] [int]...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 30, 2006 at 6:22 am
Well, that's as clear as mud to me! ![]()
My solution works against the example data I provided (at least I think it does - do...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 30, 2006 at 5:43 am
Here's one method (which doesn't use a UDF) - just run it to see... ![]()
--data
declare @t1 table (Col1 varchar(20), col2 varchar(20), col3...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 30, 2006 at 2:03 am
John - No, I was concerned about the whole design
. (I'm with you on the solution suggestion if that's going to be possible...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 29, 2006 at 10:30 am
Hi Dan
A word of warning. This is not a design you should take lightly. It could become a nightmare to work with. ![]()
You should only...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 29, 2006 at 9:57 am
Hi jonas,
Here's a simple implementation of sushila's suggestion...
--data
declare @t table (a varchar(1), b varchar(1), c varchar(1), i int)
insert @t (a, b, c)
select 'x', 'x', 'x'
union...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 29, 2006 at 9:37 am
Here's one way... ![]()
--data
declare @StartDate datetime
declare @EndDate datetime
set dateformat mdy
set @StartDate='1/1/06'
set @EndDate='1/4/06'
Ryan Randall Solutions are easy. Understanding the problem, now, that's the hard part.
March 29, 2006 at 9:21 am
Viewing 15 posts - 526 through 540 (of 683 total)