Viewing 15 posts - 136 through 150 (of 395 total)
How about this:
--== TEST DATA ==--
declare @data as table
(
CustID int,
ProdFamily varchar(15),
Route tinyint,
#ofStops int
);
insert @data values (10001, 'Dairy', 101, 14)
insert @data values (10001, 'Dry Groceries', 101, 14)
insert @data values (10001, 'Meat',...
February 22, 2013 at 10:48 am
salliven (2/22/2013)
create procedure usp_switch_data
@create_date datetime = null
,@modify_date datetime = null
as
if @create_date is not null or @modify_date...
February 22, 2013 at 5:15 am
February 22, 2013 at 4:57 am
Why not use SUM()? This will count the 1s & effectively ignore the 0s.
February 22, 2013 at 4:04 am
I had a similar problem. The table included a date, so I made the date a compulsory filter & added an index with date first, then all the other...
February 22, 2013 at 3:56 am
mkswanson (2/21/2013)
February 21, 2013 at 10:28 am
You appear to have 2 'ON' clauses in the RIGHT OUTER JOIN.
You could use aliases to simplify the code & make it more readable...
Like this:
SELECT SAL.businessDate,...
February 21, 2013 at 9:03 am
How about = instead of 'AS'
create view dbo.GlobaldataEOLT2
as
select [NUMCAM]
,[C_Fourn]
,[date_passage]
,[heure_passage]
,[banc]
,[NUMPale]
,[Module_Status]
,[Code_defaut]
,[Total_TestTime]
,[Purgerunin_TestTime]
,[ShifterPosHyst_TestTime]
,[ShifterActRespTime_TestTime]
,[GearActStroke_TestTime]
,[GearActRespTime_TestTime]
,[LeakageON_TestTime]
,[K1K2Leakage_TestTime]
,[QPVK1DeliveryTest_TestTime]
,[PPVK2PressureTest_TestTime]
,[LeakageOFF_TestTime]
,[PRVTest_TestTime]
,[OPS_NRV_Test_TestTime]
,[version_prog]
,[Jourprod] =
CASE WHEN heure_passage BETWEEN '00:00:00' and '05:59:59' THEN day(jour_passage) -2
ELSE day([date_passage]) -1
END
FROM dbo.T_EOLT_BRUTE_FLOAT
or
CASE WHEN heure_passage BETWEEN '00:00:00' and '05:59:59' THEN...
February 21, 2013 at 8:35 am
When you say it's not working - do you mean it errors or it produces unexpected results?
February 21, 2013 at 8:33 am
I haven't got SQL2000, but I think this will work.
Assuming I've understood the problem, ie it's the comparison & not the fact it's across databases...
I've used 3 tables on the...
February 21, 2013 at 8:04 am
Can you post some sample data in the same format as my test data. That would show what the problem is.
February 15, 2013 at 6:11 am
Here's a possible solution, if I've understood your requirements:
--== Create test data ==--
use tempdb;
go
drop table dbo.Trackthis;
drop table dbo.Trackingthis;
create table dbo.Trackthis
(
TrkthisID int,
name varchar(50),
Active char(5)
);
insert Trackthis values (1, 'Call', 'True');
insert Trackthis values...
February 14, 2013 at 10:37 am
This is not a good idea. It's best to use an identity for auto-incrementing numbers.
This has been covered here quite recently, & the consensus seems to be that you...
December 21, 2012 at 9:55 am
This might be a better way of doing it, if I've understood the requirement:
--== TEST DATA ==
-- Don't run this on your real table!!!
--IF OBJECT_ID('stk_matrix') IS NOT NULL
--DROP TABLE stk_matrix;
CREATE...
December 21, 2012 at 8:12 am
I don't use cursors myself but...
Surely you need a BEGIN -- END block for the WHILE?
Have you inserted the "IF @code2 = 'SUPPORT'
/* Move Support Discount to new variable...
December 21, 2012 at 8:00 am
Viewing 15 posts - 136 through 150 (of 395 total)