Viewing 15 posts - 256 through 270 (of 321 total)
SELECT
A.FacilityID,
SUM( CASE WHEN DateHired is not null THEN 1 ELSE 0 END) AS 'HireCnt',
SUM( CASE WHEN DateHired is null AND A.Facility IS NOT NULL THEN 1 ELSE 0...
June 15, 2005 at 2:51 pm
Nice...
FULL OUTER JOIN is not going to give you the right result : )
LEFT JOIN was K but NOT FULL.
If you do FULL you are going to end up with...
June 15, 2005 at 2:32 pm
Srry wrong calculations before....
this is the right solution
Declare @PartsRemaining float
DECLARE @Speed float
SELECT @PartsRemaining=300,@Speed=50
SELECT
CASE WHEN LEN(LTRIM(STR(CAST(@partsRemaining / @Speed as INT))))<2 THEN '0' ELSE '' END +
LTRIM(STR(CAST(@partsRemaining...
June 15, 2005 at 2:23 pm
SELECT
CASE WHEN LEN(LTRIM(STR(CAST(@partsRemaining / @Speed as INT))))<2 THEN '0' ELSE '' END +
LTRIM(STR(CAST(@partsRemaining / @Speed as INT)))+':'
+REPLICATE('0',2-LEN(LTRIM(STR(CAST((CAST(@partsRemaining / @Speed * 100 as INT)%100)*60...
June 15, 2005 at 2:09 pm
This will give you the HOURS and minutes
Declare @PartsRemaining float
DECLARE @Speed float
SELECT @PartsRemaining=100000,@Speed=50000
SELECT LTRIM(STR(CAST(@partsRemaining / @Speed as INT)))+':'
+REPLICATE('0',2-LEN(LTRIM(STR(CAST((CAST(@partsRemaining / @Speed * 100 as INT)%100)*60...
June 15, 2005 at 1:25 pm
I don't know why this
Select FundId From C_Funds
Where FundId NOT IN (Select ActualId from Product)-- Find New Funds
is not working ...It should
June 15, 2005 at 1:06 pm
Should work ...
PS. you have a column ActualId in C_Funds?
June 15, 2005 at 12:55 pm
Hmm that is really strange now...
Just try:
Select ActualId, FundID
From Product FULL OUTER JOIN
C_Funds ON ActualID=FundID
--Where ActualId IS NULL --return new FundID
--Where FundId IS NULL --return new ActualID
with this Query you can...
June 15, 2005 at 12:11 pm
The first statement was with the mistake the sec is correct ActualId is in fact FundId that was your mistake
June 15, 2005 at 12:03 pm
here....
Select FundId From C_Funds Where ActualId Not in(Select ActualId from Product)-- Find New Funds
Select FundId From C_Funds Where FundId Not in(Select ActualId from Product)-- Find New Funds
June 15, 2005 at 11:48 am
This is a more readable form
SELECT TOP 1
myVersion,
Case
WHEN lastdatea>=lastdateb AND lastdatea>=lastdatec AND lastdatea>=lastdated THEN lastdatea
WHEN lastdateb>=lastdatea AND lastdateb>=lastdatec AND lastdateb>=lastdated THEN lastdateb
WHEN lastdatec>=lastdatea AND...
June 15, 2005 at 10:41 am
For 5 rows... you can pick wich plan you want...
PS: the prev plan returns the full row from your table
June 15, 2005 at 7:12 am
1 Extra column can change the aproach totally...
But I would say to stick to a more complicated CASE than 3 table scans...
SELECT TOP 1
myVersion,
Case
WHEN lastdatea>lastdateb...
June 15, 2005 at 6:54 am
Viewing 15 posts - 256 through 270 (of 321 total)