Viewing 15 posts - 14,851 through 14,865 (of 15,381 total)
adam spencer (3/22/2011)
below wont work.select * from dbo.tblDM_AuditEncounter
where DM_AuditNurseID =
case when 7
then year(AE_AuditDate) = 2011
else
then year(AE_AEncounter date) = 2010
end
No it certainly won't. The result portion...
March 22, 2011 at 1:30 pm
Something like this MIGHT be what you are looking for although it is not totally clear what you are trying to get.
where year(DOS) =
CASE
WHEN AD.DM_ConfirmationID = 2 --Agreed
and year(isnull(AE.AE_PatientEncounterDate,...
March 22, 2011 at 1:16 pm
There are lots of syntax AND logic errors. in the short snippet you posted.
For syntax errors check case statement BOL entry.
March 22, 2011 at 1:03 pm
How about some ddl, sample data and a clear understanding of what you are trying to get for a result?
March 22, 2011 at 12:57 pm
prikshna67 (3/22/2011)
create table demo(id int primarykey,number nvarchar(max))
go
create trigger dbodemo
on dbo.demo
for insert
as begin
declare @pk Nvarchar(max)
declare @pkey nvarchar(max)
declare @str nvarchar(max)
select @pk = column_name from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME = 'demo'
select...
March 22, 2011 at 12:44 pm
where columnA is not null or columnB is not null or ....
March 22, 2011 at 12:30 pm
You have no table in your select...
select count(Differenceyrs)
from MyTable
group by Region,Provider,QtrName
where differenceyrs > 0
March 22, 2011 at 12:25 pm
SELECT CAST('<Root><Comment year="2009" info="This will ''kill'' my server..." /><AdditionalData bit="1" int="12345" /></Root>' AS xml).value('(/Root/AdditionalData/@bit)[1]', 'bit') AS [PseudoFieldName]
This works just fine.
March 21, 2011 at 3:35 pm
The problem is you have mixed quotes.
info="This will " kill " my server..."
change it to
info="This will '' kill '' my server..."
and it will be fine.
March 21, 2011 at 3:33 pm
Square peg meet my friend round hole.
The string you have
'<Root><Comment year="2009" info="This will " kill " my server..." /><AdditionalData bit="1" int="12345" /></Root>'
is not valid xml hence the reason...
March 21, 2011 at 3:28 pm
If you are doing this from a .net site you can use System.Uri server side before it hits sql to get what you need like this.
string myOutput = new Uri("http://www.sqlservercentral.com/Forums/Topic1080875-1291-1.aspx").Host;
March 21, 2011 at 2:13 pm
After reading your latest posts I am more confused about what you are trying to do than I was before. I don't understand why you have to convert html to...
March 21, 2011 at 1:40 pm
I think unless you were able to capture this via trace you are pretty much outta luck. Pretty much impossible to find the date that something that no longer exists...
March 21, 2011 at 1:19 pm
That is a really strange requirement. So basically you have two copies of every row???
what about something like
select distinct col1, col2, 1 as SortOrder
union
select distinct col1, col2, 2
order by SortOrder,...
March 21, 2011 at 8:00 am
Please don't crosspost. The original thread is here
March 21, 2011 at 7:53 am
Viewing 15 posts - 14,851 through 14,865 (of 15,381 total)