Viewing 15 posts - 481 through 495 (of 1,923 total)
THis?
SELECT * FROM #Fred;
; WITH CTE AS
(
SELECT OrganisationID , LocationID ,CT = COUNT(*) --, Cnt = COUNT(*) OVER ( PARTITION BY OrganisationID , LocationID)
FROM #Fred
GROUP BY OrganisationID , LocationID
)
,...
February 29, 2012 at 6:52 pm
Can you provide us a sample input and expected output for that sample input?
February 29, 2012 at 4:18 pm
Request 1 - Lower ur Caps while posting the question. It is sore to the eyes while reading.
Request 2 - Though you have 75% succeeded in showing what you want...
February 29, 2012 at 1:10 pm
Sean Lange (2/27/2012)
I guess that way you would ensure that one and only customer can be active at any one time??? 😛
:hehe:
February 27, 2012 at 3:43 pm
Sean Lange (2/27/2012)
ColdCoffee (2/27/2012)
CELKO (2/27/2012)
CREATE TABLE Customer_History
(customer_id CHAR(9) NOT NULL,
start_date DATE DEFAULT CURRENT_TIMESTAMP NOT NULL,
end_date DATETIME UNIQUE, --null means current
CHECK (start_date <= end_date),
...
February 27, 2012 at 3:20 pm
CELKO (2/27/2012)
CREATE TABLE Customer_History
(customer_id CHAR(9) NOT NULL,
start_date DATE DEFAULT CURRENT_TIMESTAMP NOT NULL,
end_date DATETIME UNIQUE, --null means current
CHECK (start_date <= end_date),
foobar_status CHAR(??) NOT...
February 27, 2012 at 11:34 am
How quickly should the data in Balance table be updated? is it instantaneously ?
February 27, 2012 at 11:27 am
Either LoginPassword or LoginSKey (or other cols) is a VARBINARY(MAX) data-type. you can not convert 'xxxx' implicitly.. You have to wrap like this CAST( 'XXXX' AS varbinary(max)) or CONVERT(VARBINARY(MAX) ,'XXXX')
February 23, 2012 at 3:00 pm
ACinKC (2/23/2012)
nscott 48570 (2/21/2012)If bmovedout is null, it is unknown (and therefore not true)?
The key point to help you understand what's going on is to know what NULL actually represents....
February 23, 2012 at 11:47 am
You go to do this via Dynamic SQL
February 23, 2012 at 11:08 am
I am bit lost here... is your requirement to find the count of rows that are exactly older than 30 days?
If yes, then use this
DECLARE @Dateparam DATETIME = '3-MAR-2012'
SELECT ...
February 22, 2012 at 7:15 pm
Ray K (2/22/2012)
It looks like the CTE might be the best bet. Obviously, it works fine with the data sample I put together;...
February 22, 2012 at 3:49 pm
Evil Kraig F (2/22/2012)
ColdCoffee (2/22/2012)
Both of them wont work if the number of degrees queried is just one.
Agreed, I was answering the initially asked question of what method to use...
February 22, 2012 at 3:41 pm
Evil Kraig F (2/22/2012)
SELECT
p.ID,
p.[name]
FROM
#Degree
join #DegreeJct on #Degree.ID = #DegreeJct.DegID
join #People AS p on #DegreeJct.UserID...
February 22, 2012 at 3:35 pm
How about this?
; WITH CTE AS(
SELECT DegName = DEG.Deg
,PerName = PEP.Name
,ContOcc = COUNT(PEP.Name) OVER(PARTITION BY PEP.Name)
FROM #DegreeJct ...
February 22, 2012 at 3:26 pm
Viewing 15 posts - 481 through 495 (of 1,923 total)