Viewing 15 posts - 181 through 195 (of 429 total)
Is you'r welcomed forum standard now!!!! Thanks to noel.
August 18, 2005 at 8:43 am
I was in a hurry to beat you and lost again.
August 18, 2005 at 8:17 am
SELECT DATEPART(YEAR, SaleDate) SaleYear, Product, AVG(SaleQty)/12 AvgSalesPerMonth
FROM
orderdetail
GROUP BY DATEPART(YEAR, SaleDate), Product
August 18, 2005 at 8:08 am
Stupid Answer.
Write a trigger to take care of that.
Remi as mentioned in your first answer the design is not correct. There is no need...
August 18, 2005 at 8:05 am
Provide
Schema, Sample Data, Required Results to help us to help you. I don't undersatnd completely what is needed.
August 18, 2005 at 7:43 am
I assume the data provided is with little error. See the corrected data and the solution
SET NOCOUNT ON
SET DATEFORMAT MDY
create table #tblTempRetros(DateOpe datetime, Stock int, Subscriber int, Amount int)
insert into...
August 18, 2005 at 7:26 am
SELECT *
FROM
UploadData U
JOIN
ServerError S
ON
S.ErrorDate BETWEEN DATEADD(SECOND, 5, U.UploadTime) AND DATEADD(SECOND, 300, U.UploadTime)
I would have to say this will fetch morethan one error for an upload if two...
August 17, 2005 at 8:12 pm
IIF is VB function
For T-SQL u can use
CASE WHEN fieldName IS NULL THEN 0 ELSE fieldName END
or
ISNULL(fieldName, 0)
or
COALESCE(fieldName, 0)
For your case it can be
CASE WHEN COALESCE(FieldName, '') = ''...
August 17, 2005 at 10:22 am
Try this no cursor or loop
UPDATE EC_OIT
SET
OrderItemID = EC_M.OrderID
FROM
EC_OrderItemTaxes EC_OIT
JOIN
(
SELECT Match.[ID] TaxID, EC_OI.[ID] OrderID
FROM
EC_OrderItems EC_OI
LEFT JOIN
(
SELECT IT.[ID], OI.OrderID
FROM
EC_OrderItemTaxes IT
JOIN
EC_OrderItems OI
ON
IT.OrderItemID = OI.[ID]) Match
ON
EC_OI.OrderID = Match.OrderID
WHERE
EC_OI.GlobalProductID <> 201) EC_M
ON
EC_OIT.[ID] = EC_M.[TaxID]
August 17, 2005 at 10:20 am
May be this needs another topic. I am just wondering since the row size is 8060. What is the point in having a column with 8000 unless it is a...
August 17, 2005 at 9:29 am
Yes yes yes
I have been doing this for zillion times. I need a coffee. Sorry for the confusion.
My mind was thinking like below even after Vasc mentioned
[Baseball65K50].[Col007] = [Baseball65K24].[Col005] AND
[Baseball65K50].[Col007] IS...
August 17, 2005 at 9:04 am
Enterprise Manager will use a sytax like
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_MyTableName
(
MyTableName numeric(38, 16) NOT NULL) ON [PRIMARY]
GO
IF EXISTS(SELECT * FROM dbo.MyTableName)
EXEC('INSERT INTO dbo.Tmp_MyTableName (MyFieldName)
SELECT CONVERT(numeric(38, 16), MyFieldName) FROM dbo.MyTableName TABLOCKX')
GO
DROP...
August 17, 2005 at 8:53 am
Do you mind posting the schema and sample data. There must be a way to do this without a cursor.
August 17, 2005 at 8:35 am
Vasc What I mean was that does't mean any thing. Synatax is correct and the join will not add any thing. It is as good as not having that join.
August 17, 2005 at 8:28 am
Viewing 15 posts - 181 through 195 (of 429 total)