Viewing 15 posts - 541 through 555 (of 627 total)
Did you copy and paste my code and tried it?
My results are:
c1c2Termstotal
533RobinNULL533.00
655SteveNULL655.00
June 17, 2015 at 12:37 pm
Sorry the VARCHAR(6) should have been a giveaway.
Hmmm...with the IF statement being Identical it is puzzling but without any more info I'm not sure.
Just another shot in the dark here...
June 17, 2015 at 12:10 pm
Try this:
--Create table test
CREATE TABLE [dbo].[test](
[c1] [varchar](30) NULL,
[c2] [varchar](20) NULL
) ON [PRIMARY]
--Insert values in to the test table
Insert into test values ('533','Robin')
Insert into test values ('655','Steve')
GO
--Create View
create view [dbo].[test_vw]
as
select *,...
June 17, 2015 at 11:37 am
Are you sure your predicates are identical in both IF clauses. In your test you set your parameters but I can't tell if you used those exact values in...
June 17, 2015 at 11:23 am
The database size will not change no matter how many rows you delete. To better understand this you should do some research on how SQL actually stores data. ...
June 17, 2015 at 9:26 am
RP_DBA (6/16/2015)
DECLARE @StartDate DATE = '20150601'
,@EndDate DATE =...
June 16, 2015 at 2:17 pm
This should work:
NOTICE - I purposely created a gap for CBA to demonstrate.
DECLARE @test-2 TABLE ([Index] INT, FactorS NVARCHAR(3), Value DECIMAL(2,1), [Date] DATE)
INSERT INTO @test-2 ([Index],...
June 16, 2015 at 1:46 pm
GilaMonster (6/16/2015)
yb751 (6/16/2015)
If so than you could (ironically) make use of the LAG function. Otherwise Jeff's solution will work just fine.
Unless I'm missing something, LAG won't produce the results...
June 16, 2015 at 1:36 pm
Robert klimes (6/16/2015)
read the post at the link in my...
June 16, 2015 at 1:02 pm
Fairly straightforward, try this:
SELECT
MRN,
DischargeDate,
ApptDate,
DATEDIFF(dd,DischargeDate,ApptDate) AS DayDifference
From
Test
WHERE
DATEDIFF(dd,DischargeDate,ApptDate) <= 7
LOL, I feel like I'm answering a question for a former employer. (I used to be in Healthcare)
June 16, 2015 at 12:38 pm
6 single quotes does work as a replacement string because...
'<-Outside quotes contain your string->'
The 2nd & 3rd '' will become a single quote because the 2nd is used to...
June 16, 2015 at 11:55 am
It's a little tricky to demonstrate because you have to escape the single quote in the example itself but the execution is fairly simple.
DECLARE @quotedString NVARCHAR(10) = 'ABC''DEF''GHI'
SELECT REPLACE(@quotedString,'''','"');
June 16, 2015 at 11:36 am
Michael L John (6/15/2015)
yb751 (6/15/2015)
Did you try using GO?Example:
First SP
GO
Second SP
This will not work inside a procedure.
Can you post your code?
Darn...missed that in the OP
June 15, 2015 at 12:38 pm
Viewing 15 posts - 541 through 555 (of 627 total)