Viewing 15 posts - 121 through 135 (of 338 total)
Do these columns exist in any of the referred tables of the query ?
Msg 207, Level 16, State 1, Line 1
Invalid column name 'pmDescription'.
Msg 207, Level 16, State 1, Line...
June 19, 2014 at 6:54 am
Replace EXEC(@sql) with PRINT(@sql) and check the output of the print statement.Try running the printed sql in the query window.
June 19, 2014 at 6:51 am
You need to post here the Table and XML structure..
June 19, 2014 at 5:18 am
Something like this
SELECT SUM(YourSum) FROM
(
SELECT SUM(CASE WHEN SOA_TYPE = 'Agent' THEN USD_AMOUNT ELSE 0 END) +
SUM(CASE WHEN SOA_TYPE = 'Freight' THEN USD_AMOUNT ELSE 0 END) +
SUM(CASE WHEN SOA_TYPE...
June 19, 2014 at 5:14 am
Using TimeFromParts function.
DECLARE @startDate datetime , @endDate datetime ,@getdate date
SET @getdate = getdate()-1
SET @startDate = convert(varchar(30),@getdate) + ' ' + convert(varchar(30),Timefromparts(01,0,0,0,0))
SET @endDate =@startDate+1
SELECT *
FROM TABLE
WHERE [datetime] BETWEEN @startDate AND @endDate;
June 19, 2014 at 5:10 am
oradbguru (6/19/2014)
Sorry, I should have stated that they will not always be the same. Thank you.
In that case you can use the second query I had posted.
June 19, 2014 at 3:05 am
CREATE TABLE #patient_readmission
(
id INT IDENTITY,
...
June 19, 2014 at 2:41 am
Value of stolen pages looks quite high to me.Stolen=4125133.Lots of hash and sort operations ?
Value of PLE also seems quite low,only 632 for a 64 GB memory.
June 19, 2014 at 1:31 am
If the lictype's are known in advance you can simply use this
SELECT pmdescription,
smdescription,
mstr_list_item_desc,
...
June 19, 2014 at 12:19 am
Will the lictype always be of these 3 types ?
HealthWise
PatientPortal
RealTime
June 18, 2014 at 10:19 pm
Why should the value of Index_AMI be 1 for encounter id=16260 though the previous discharge date is less than 30 days of the admit date ?
June 18, 2014 at 8:43 am
Here is a non SQL 2012 method.This would require a row identifier column which I believe every table should have.But personally I have seen LEAD/LAG functions performing way better than...
June 18, 2014 at 12:47 am
I dont think there is need for query 2 as you are already grouping and aggregating on the same columns in query 1.
Can you verify whether the resultset from query...
June 18, 2014 at 12:18 am
The error is not because of the change.The error is thrown by the SP instead.Try searching for text "No records were found macthcing your criteria" in the SP.
matching in misspelled...
June 17, 2014 at 10:45 am
Another use of LEAD function
SELECT QueueId,TaskId,TaskName,Rundatetime FROM(
SELECT T.QueueId,T.TaskId,T.TaskName,T.RunDateTime, LEAD(taskid,MaximumQueueLength)OVER(PARTITION BY T.QueueId ORDER BY taskid DESC)lid FROM Tasks T
INNER JOIN Queue Q ON T.QueueId=Q.QueueId
)T1 WHERE lid IS NULL ORDER BY TaskName
EDIT:...
June 16, 2014 at 1:55 am
Viewing 15 posts - 121 through 135 (of 338 total)