Viewing 15 posts - 6,631 through 6,645 (of 10,144 total)
p.stevens76 (10/3/2011)
The first part of my query is the bit i'm stuck with. It give sme...
October 3, 2011 at 9:25 am
p.stevens76 (10/3/2011)
No, it's an addition. trying to work through this in stages. This is the last stage.Sorry for the confusion.
The two queries (subqueries) look the same to me:
select...
October 3, 2011 at 8:39 am
p.stevens76 (10/3/2011)
from dbo.PS_AE_Delete
where (CONVERT(date, arrival, 101) >= '2011-02-01 00:00')
AND (CONVERT(date, arrival, 101) <= '2011-04-30 23:59')
and [Att_Type] = 'New Attender'
group by Dept, year(Arrival),month(Arrival)...
October 3, 2011 at 8:25 am
Add this to your SELECT list:
Another_New_attender_Count = COUNT(*) OVER (PARTITION BY R.Dept, YEAR(Arrival), MONTH(Arrival))
October 3, 2011 at 7:53 am
:blush: shucks it's just a copy of yours Luca!
October 3, 2011 at 7:12 am
Why start a new thread? Try this:
SELECT
New_attender_Count = COUNT(*) OVER (PARTITION BY R.Dept),
--New_attender_Count = (
--select COUNT(*)
--from dbo.PS_AE_Delete
--where (CONVERT(date, arrival, 101) >= '2011-02-01 00:00')
--AND (CONVERT(date, arrival, 101) <=...
October 3, 2011 at 5:37 am
Here's a slightly different method. BTW check the date in your first insert.
;WITH FilteredData AS (
SELECT o.MeterNumber, o.SlotTimeStamp, o.FeederStatus,
seq = ROW_NUMBER() OVER(ORDER BY o.SlotTimeStamp)
FROM (
SELECT d.MeterNumber, d.SlotTimeStamp, d.FeederStatus,...
October 3, 2011 at 5:03 am
SELECT MyResult = 0 |CONVERT(INT, RoleID) FROM UsersRoles WHERE UserID = 23
October 3, 2011 at 4:09 am
Sorry, been busy
-- set up some sample data
DROP TABLE #ROCdata
CREATE TABLE #ROCdata (ID INT NOT NULL, Symbol_Code VARCHAR(12), Transaction_date DATE, Close_Price MONEY)
INSERT INTO #ROCdata (ID, Symbol_Code, Transaction_date, Close_Price)
SELECT 1,...
September 27, 2011 at 9:20 am
SELECT K.[test],
CASE
WHEN K.[test] = 'N/A' THEN '0'
WHEN CAST(K.[test] AS DECIMAL(5,1)) BETWEEN 0 AND 19.9 THEN '1'
WHEN CAST(K.[test] AS DECIMAL(5,1)) BETWEEN 20 AND 34.9 THEN '2'
WHEN CAST(K.[test] AS DECIMAL(5,1))...
September 26, 2011 at 10:27 am
The arithmetic doesn't work as it stands:
--([Close price on 12 day] -[Close price on Thirteenths day(today)] )/ ([Close price on Thirteenths day(today)] *100)
-- = -3.85 [today''s close]
SELECT (10782.95 -...
September 26, 2011 at 10:10 am
Does this give the same results as your query?
SELECT
[New_attender_Count] = 0, -- maybe COUNT(*) OVER(PARTITION BY something),
F.pat_pid as Patient_ID,
F.Arrival as F_Att_Date,
F.Dept as F_Att_Site,
F.atd_id as F_Att_ID,
F.atd_num as F_Att_Num,
F.Att_Seq_No as...
September 26, 2011 at 10:00 am
sushilb
Start a new thread.
Write a concise but complete and accurate description of what you want to do. Code which works can be a useful aid to understanding requirements, code which...
September 26, 2011 at 9:18 am
USE tempdb
GO
IF OBJECT_ID('tempdb..Test') IS NOT NULL DROP TABLE Test
CREATE TABLE Test (JurisID CHAR(4), CodeID CHAR(4), CodeIDDescr CHAR(4), SrcCodeDescr CHAR(4), PnxCodeId INT IDENTITY (1,1), PnxCodeValue AS (1000-PnxCodeId), IsConverted BIT)
INSERT INTO Test...
September 26, 2011 at 7:24 am
Rokh (9/22/2011)
Like stated before, the inner join is not be removed. It represents a real life situation. I've only skinned it down for this forum. Call it respect...
September 26, 2011 at 5:30 am
Viewing 15 posts - 6,631 through 6,645 (of 10,144 total)