Viewing 15 posts - 7,876 through 7,890 (of 10,144 total)
;with testcte (ID, PatientID, Drug, DatePrescribed, rnum)
as
(
select *,
row_number () over(partition by convert(varchar,DatePrescribed,101) order by DatePrescribed) as rnum
from #Prescriptions
)
select f.*,
case when coalesce(s.rnum, t.rnum) is not null then 'PossibleDrugSeeker' else...
May 21, 2010 at 9:39 am
bnordberg (5/21/2010)
May 21, 2010 at 8:43 am
John Rowan (5/21/2010)
Chris Morris-439714 (5/21/2010)
John Rowan (5/20/2010)
I have 5 kids under the age of 10I reckon we should all club together and buy John a telly.
Telly?
Something else to do...
May 21, 2010 at 8:28 am
marin-231997 (5/21/2010)
well, I'd really like to see how your queries look like after you've had your cup of coffee 🙂 , but this one just hits the nail on...
May 21, 2010 at 8:26 am
cgreathouse (5/21/2010)
I've tried something similar without much luck. Thanks for trying!I'm now playing around with CTEs to see if that will work. Anybody else have any suggestions?
Thanks!
Yep, if...
May 21, 2010 at 8:12 am
marin-231997 (5/21/2010)
thanks for your input.
Unfortunately it is not what I'd like to achieve. I need a way to "flag" the rows having identical values in column _VAL3 (kind of...
May 21, 2010 at 8:04 am
marin-231997 (5/21/2010)
I wonder if following is somehow possible:
I'd like to add an extra column to my existing query which would indicate the rows with identical values in certain column.
Sample...
May 21, 2010 at 7:53 am
Have you looked into Jeff's suggestion yet?
NULLIF(MyDodgyColumn, '')
May 21, 2010 at 7:45 am
Robb, can you please confirm that you are running on SQL Server 7 or 2k?
May 21, 2010 at 7:43 am
And if it is correct, then this should do the trick:
SELECT
p.packageID,
p.ClientID,
p.StartDate,
p.EndDate,
DATEPART(MONTH, GETDATE()) AS currMonth
FROM p
WHERE
(p.StartDate <= CONVERT(datetime, CONVERT(varchar,DATEPART(year,GETDATE()) +
CASE WHEN DATEPART(MONTH, GETDATE()) >...
May 21, 2010 at 7:24 am
Oh don't worry about that, getting the conditional to work properly is the easy bit. Getting the logic engraved in stone first is essential - and the hard bit. Now,...
May 21, 2010 at 7:19 am
karthikeyan-444867 (5/20/2010)
Step2 : I used 'Tally' table to split the delimited values
Step3 : Splittled values will be stored in a table as rows.
...
May 21, 2010 at 4:31 am
Hi David
Could you please review the attached pseudocode and confirm that it's logically what you're looking for?
DECLARE @NextMarch DATETIME, @ThisMarch DATETIME, @ThisApril DATETIME, @LastApril DATETIME
SET @NextMarch = convert(datetime, convert(varchar,datepart(year,getdate())+1) +...
May 21, 2010 at 3:13 am
John Rowan (5/20/2010)
I have 5 kids under the age of 10
I reckon we should all club together and buy John a telly.
May 21, 2010 at 2:09 am
Viewing 15 posts - 7,876 through 7,890 (of 10,144 total)