Viewing 15 posts - 151 through 165 (of 402 total)
Both, thank you for the replies very helpful
I'm interested (just out of curiosity) if there are any other ways to achieve the same result without using a recursive query if...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 16, 2012 at 4:35 am
Why did you make the customer id an integer?
Errm because it makes MUCH more sense than a CHAR(10) Mr C!!! :crazy:
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 9:07 am
Can you ship some to the UK for us please? Reading them reviews after a quick Google, sounds right up my street.
Yep - I would be up for some...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 8:32 am
Sorry just got back from a meeting - Looking much better now 🙂
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 8:31 am
Since two of the main methods have already been suggested I thought I'd introduce a third into the mix for completeness:
SET ARITHABORT OFF
SET ANSI_WARNINGS OFF
SELECT ISNULL([Numerator] / [Denominator], 0)
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 7:33 am
karen.blake (7/13/2012)
When you say overcomplicated...what do you mean? Always looking to improve , this query is quite old now (I had to dig it...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 7:23 am
Give that a try
Just as a side looks like this query is over complicated a bit..
But if your happy 🙂
SELECT suppgroup, CAST(AvgMins/60 AS VARCHAR(10)) + ':' + RIGHT('00' + CAST(AvgMins%60...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 6:59 am
No worries 🙂
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 5:32 am
Hi
Your GROUP BY was outside your sub-query
SELECT CAST(AvgMins/60 AS VARCHAR(10)) + ':' + RIGHT('00' + CAST(AvgMins%60 AS VARCHAR(10)), 2)
FROM
(SELECT SUM(fix_time/60)/COUNT (*) AS AvgMins, suppgroup
FROM
calltable
WHERE
suppgroup IN ('WEBS', 'Tech','SQL')
AND...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 5:29 am
I have the alocohol for the weekend lined up, 2 bottles of Innis & Gunn's, 2 bottles of Moorhouse brewery's Pendle Witches Brew and 2 bottles of Hoegarden Rose.
Sounds like...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 5:09 am
Hi
There are certainly other ways of doing this but due to time constraints here is one way if I have understood correctly:
DECLARE @MYTABLE1 AS TABLE
(
CustomerId INT
,TransactionId INT
,TransDate DATETIME
,PointsEarned INT
)
DECLARE...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 3:23 am
Hi I may be misunderstanding but shouldn't your main query be:
SELECT *
FROM
Sales
WHERE
R_Type IN (@R_Type)
AND T_Type IN (@T_Type)
Andy
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 13, 2012 at 2:12 am
I had that warning the other day but didn't get round to investigating..
Thanks for posting the solution 🙂
Andy
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 12, 2012 at 9:06 am
Or UNPIVOT
CREATE TABLE #Temp1
(EmpName varchar(50),
PAccess varchar(2),
HAccess varchar(2),
CAccess varchar(2))
INSERT INTO #Temp1 values ('John D','0','1','1')
INSERT INTO #Temp1 values ('Chris H','0','0','1')
INSERT INTO #Temp1 values ('Mary G','1','0','0')
INSERT INTO #Temp1 values ('Tom H','1','1','0')
INSERT INTO #Temp1...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 12, 2012 at 8:08 am
Hi
This error means that you have a foreign key referencing your table.
To perform this update you will have to remove the constraint Fk_Inventory_BookLocation from the table
I would be very careful...
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
July 12, 2012 at 5:45 am
Viewing 15 posts - 151 through 165 (of 402 total)