Viewing 15 posts - 151 through 165 (of 414 total)
Will this solve your problem?
declare @table table(Name varchar(10), CreditCardNo int)
insert @table select 'Arun', 1234567
insert @table select 'Arun', 3456787
insert @table select 'Amit', 5634566
insert @table select 'Amit', 2345565
select Name, min(CreditCardNo), max(CreditCardNo) from...
January 18, 2006 at 8:16 am
Interesting link....
Do we know that the column PublishOnIntra is included in an index? If it isn't, I still think that my suggestion can...
January 18, 2006 at 7:34 am
Despite the description of the table in the initial post, I don't think there is an identity column (or a sequential ID) on the table. Quote:
January 18, 2006 at 7:09 am
Maybe
WHERE (@READONLY=1 or PublishOnIntra = 1)
is better. This way, the condition "PublishOnIntra = 1" is probably ignored when @READONLY equals 1. But I am not sure....
January 18, 2006 at 6:02 am
Please explain in more detail why my method fails - the code below returns "05-12" as requested...
declare @Dates table(Code varchar(10), StartDate datetime, EndDate datetime)
insert @Dates select '05-10', '2005-10-01 00:00:00.000', '2005-10-28...
January 17, 2006 at 1:53 am
Correction: Replace getdate() above by
dateadd(d, datediff(d, '1900', getdate()), '1900')
to get rid of hours, minutes, seconds and milliseconds...
January 16, 2006 at 6:31 am
Oh, I thought this problem was about calculating all rows of the table you were referencing above
I assume (now) that you have a...
January 16, 2006 at 6:26 am
Could you state more precisely how StartDate and EndDate are calculated? StartDate is always a Saturday, not a Monday...
It seems to be enough to describe how one of the dates are...
January 16, 2006 at 5:55 am
Then you will also get "0 = NULL"-matches, which is probably not what you want....
January 13, 2006 at 12:03 pm
To run this I needed a minor modification:
create table #t (detail varchar(255) null)
January 13, 2006 at 7:35 am
You could use
(x = y or (x is null and y is null)),
(x != y or (x is null and y is not null) or (x is not null and...
January 13, 2006 at 7:29 am
Glad you worked it out , it's more complicated than the first problem. I would probably have attempted a similar solution...You might however want...
January 13, 2006 at 7:15 am
You are probably thinking of something like this:
select p.* from @PeriodsPossible p
where not exists
(select * from @PeriodsUsed u
where
(p.StartDate <= u.StartDate and u.StartDate <= p.EndDate)
or
(u.StartDate <= p.StartDate and p.StartDate <= u.EndDate)
)
It...
January 13, 2006 at 5:52 am
Try this:
declare @PeriodsUsed table (StartDate datetime, EndDate datetime)
insert @PeriodsUsed select '2006-05-05', '2006-05-17'
insert @PeriodsUsed select '2006-05-24', '2006-05-24'
insert @PeriodsUsed select '2006-06-01', '2006-06-22'
declare @PeriodsPossible table (StartDate datetime, EndDate datetime)
insert @PeriodsPossible select '2006-05-01', '2006-05-05'
insert...
January 13, 2006 at 4:07 am
Viewing 15 posts - 151 through 165 (of 414 total)