Viewing 15 posts - 2,101 through 2,115 (of 6,037 total)
You may try to use WITH ROLLUP option in your query.
It won't remove all the rows with CompanyID's from the final recordset, but will add 2 records to it"
YEAR ...
_____________
Code for TallyGenerator
March 11, 2013 at 4:55 pm
I would not update the master table but set up another "queue" table for approval requests.
Once a "details" row is updates the coresponding key value is inserted by the trigger...
_____________
Code for TallyGenerator
March 10, 2013 at 9:54 pm
Replace "Not working" part with this:
INNER JOIN (
SELECT PATIENT_ID, MIN(Date_Written) MIN_START, MAX(EXPIRES_ON) MAX_START
FROM [dbo].[PT_CASE]
GROUP BY PATIENT_ID ) AS Ptc ON [Pat].[PATIENT_ID] = [Ptc].[PATIENT_ID]
and simply add MIN_START,...
_____________
Code for TallyGenerator
March 10, 2013 at 9:29 pm
YOu may folow the money :hehe: by tracing intermediate results:
select (1400.05 / 4232.33 ), (1400.05 / 4232.33 ) * 4180.06, round((1400.05 / 4232.33 ) * 4180.06 ,2) --Statement 1
declare @v1...
_____________
Code for TallyGenerator
March 6, 2013 at 5:12 pm
Steven Willis (3/5/2013)
Sergiy (3/5/2013)
Whatever...
🙂
These values "10:35","14:22", etc. are from an HTML form and they are posted as strings generated by a hard-coded HTML dropdown with the 5 character pseudo-"time"...
_____________
Code for TallyGenerator
March 5, 2013 at 5:28 pm
Steven Willis (3/4/2013)
_____________
Code for TallyGenerator
March 5, 2013 at 3:44 pm
Jeff Moden (3/4/2013)
UPDATE dbo.Analysis
SET AccMargin = ((MArgin+Freight)/Gallons)
Of course, since you're...
_____________
Code for TallyGenerator
March 4, 2013 at 10:08 pm
See BOL for descrioption of ROUND function.
...
function
Is the type of operation to perform. function must be tinyint, smallint, or int. When function is omitted or has a value of...
_____________
Code for TallyGenerator
March 4, 2013 at 6:19 pm
Steven Willis (1/2/2013)
_____________
Code for TallyGenerator
March 4, 2013 at 6:10 pm
Sean Lange (3/4/2013)
SELECT rc.ResultCode,
COUNT(a.AccountNumber)
FROM ResultCodes rc
LEFT OUTER JOIN Accounts a ON rc.ResultCode = a.ResultCode
left JOIN [Types] t ON a.AccountNumber = t.AccountNumber and t.[Type] = 'MHIC'
GROUP...
_____________
Code for TallyGenerator
March 4, 2013 at 4:14 pm
Sean Lange (2/27/2013)
. A view does not store any data so the calculation would not be stored.
An indexed view does.
Another name for it is "materialized view" - because all...
_____________
Code for TallyGenerator
February 27, 2013 at 9:31 pm
To get unique vaues you just need to group the entries for the columns (that applies to all kind of queries, not only to "FOR XML" ones :hehe: ):
SELECT a.ID,
...
_____________
Code for TallyGenerator
February 27, 2013 at 9:19 pm
There is no need for outer apply here
DECLARE @string VARCHAR(8000) = '{White,Black,Green}';
SET @string = REPLACE(REPLACE(@string,'{',''),'}','');
SELECT Name, ISNULL(Item,'Other') AS Color, IDX
FROM #testEnvironment a
LEFT JOIN [dbo].[DelimitedSplit8K](@string,',') b on b.Item =...
_____________
Code for TallyGenerator
February 27, 2013 at 6:14 pm
Sean Lange (2/25/2013)
.. you would need to add the computed column to your base table.
or create an indexed view.
There are requirements to meet though - check BOL for details.
_____________
Code for TallyGenerator
February 25, 2013 at 8:29 pm
ScottPletcher (2/25/2013)
But they may need spool space just like any other table or view used multiple times for lookups, etc., yes?
[I actually don't know if SQL spools go to tempdb...
_____________
Code for TallyGenerator
February 25, 2013 at 6:45 pm
Viewing 15 posts - 2,101 through 2,115 (of 6,037 total)