Viewing 15 posts - 9,976 through 9,990 (of 10,144 total)
So you're looking to match, one for one, your sales & refunds, and examine what's left?
February 5, 2008 at 10:52 am
This looks suspiciously like homework to me! However...here's half of what you need...
DROP TABLE #Widgets
CREATE TABLE #Widgets (TranDate DATETIME, Product VARCHAR(10), quantity INT, value MONEY)
INSERT INTO #Widgets (TranDate, Product, quantity,...
February 5, 2008 at 10:43 am
DECLARE @TheDate DATETIME, @HalfDayAndaBit DECIMAL (14,13)
SET @HalfDayAndaBit = 0.5000000385803
SET @TheDate = '2008-02-05 11:59:59.993'
SELECT @TheDate
SELECT CAST(@TheDate-@HalfDayAndaBit AS INT)
SELECT CAST(CAST(@TheDate-@HalfDayAndaBit AS INT) AS DATETIME)
SET @TheDate = '2008-02-05 11:59:59.997'
SELECT @TheDate
SELECT...
February 5, 2008 at 9:25 am
DECLARE @TheDate DATETIME
SET @TheDate = '2008-02-05 23:59:59.997'
SELECT @TheDate
SELECT CAST(CAST(@TheDate-0.5000000385803 AS INT) AS DATETIME)
SET @TheDate = '2008-02-05 00:00:00.000'
SELECT CAST(CAST(@TheDate-0.5000000385803 AS INT) AS DATETIME)
😉
We're still on 2K, could be decades...
February 5, 2008 at 7:11 am
Running an update against a table with a little over 500,000 rows I get the following (average of three runs, in seconds)
1) CAST / FLOOR / CAST [2.32]
2) DATEADD /...
February 5, 2008 at 4:29 am
Not yet, Derek. Derek? Where'd he go? 😉
February 5, 2008 at 3:54 am
Have a play with the following, it should help you identify where the sp is failing:
DROP TABLE #Offboardv7
GO
CREATE TABLE #Offboardv7(
[ID] [int] NOT NULL,
[SID] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LAST_NAME] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS...
February 5, 2008 at 2:50 am
Skinning a cat innit:
SELECT [DateOnly] = CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) -- CAST / FLOOR / CAST
SELECT [DateOnly] = dateadd(dd,datediff(dd, 0, getdate()), 0) -- DATEADD / DATEDIFF
SELECT [DateOnly] = CAST(CAST(GETDATE()...
February 5, 2008 at 2:17 am
It's perhaps worth a look. The error message states something about nested cases, but case nesting isn't necessary for the error - just more than 10 options in one case...
February 1, 2008 at 7:59 am
This is probably a long shot Paul, but what is the maximum number of options you have in a single CASE construct? There's a limit, when running a query against...
February 1, 2008 at 7:37 am
You're very welcome Brian, and many thanks for the feedback.
January 31, 2008 at 11:35 pm
Ian Yates (1/31/2008)
update...
January 31, 2008 at 10:19 am
Matt Miller (1/31/2008)
Actually - I thought QWIRKY was the layout...
January 31, 2008 at 10:11 am
Good point Matt, I don't know the answer but your suggestion is pretty easy to check out. The system is Lawson which I'm finding out is kinda "pernickity" and quirky...
January 31, 2008 at 9:32 am
Viewing 15 posts - 9,976 through 9,990 (of 10,144 total)