Viewing 15 posts - 316 through 330 (of 3,957 total)
I would add to this that we'll probably need to know what values are stored in the Leveln columns of the employee table.
DDL and consumable sample data (INSERTs) would probably...
February 23, 2015 at 5:28 pm
Allow me to ask a dumb question or three.
Why would you create a constraint like that in the first place?
What is the NULLable property of the column?
Why not just store...
February 23, 2015 at 5:24 pm
I believe that there is another way.
PRINT 'Create the sample data';
--===== Declare some obviously named variables
DECLARE @NumberOfRows INT,
@StartDate DATETIME,
...
February 23, 2015 at 4:53 pm
david.dunst (2/23/2015)
SELECT r.RepCode,
IsNull((Select SUM(s.SO_Amount)
FROM SO_Table so
WHERE so.RepCode = r.RepCode
...
February 23, 2015 at 4:42 pm
Perhaps this?
WITH SO (RepCode, SOAmount, SODate) AS
(
SELECT 1, 100, '1/2/2015'
UNION ALL SELECT 2, 50, '2/15/2015'
UNION ALL SELECT 3,...
February 22, 2015 at 8:14 pm
VegasL (2/22/2015)
Yes, thank you for your last update, it was spot on.
I modified you're original query and added a column to No_Of_Words, for the column result set of mw,...
February 22, 2015 at 5:26 pm
Jason-299789 (2/20/2015)
Thankfully the rate was always at current day, so we didn't have to worry about rates on a specific date, but that's easily fixes with a join on date.
Hehe....
February 20, 2015 at 12:37 am
Using Laurie's set up data, this is probably also an option:
SELECT Number
,NewDate = MAX(CASE Stat...
February 19, 2015 at 9:22 pm
The thing I see missing from this is that currency exchange rates change daily. Where's the effective date for lookup of the exchange rate?
Note that this doesn't need to...
February 19, 2015 at 9:02 pm
CELKO (2/18/2015)
I need to create random alphanumeric characters as primary key values when inserting a record [sic]. .. I don't want to use GUID or auto increment integer...
February 19, 2015 at 5:06 pm
matzj (2/19/2015)
February 19, 2015 at 5:02 pm
Forgot to mention. You might want to take a look at this article.
Creating a Date Range from Multiple Rows Based on a Single Date[/url]
It covers what I'd prefer as...
February 18, 2015 at 8:45 pm
Deleting a rather dumb idea, hopefully before anyone saw it.:-D
February 18, 2015 at 6:47 pm
CELKO (2/17/2015)
As the OP said Joe, he's building a report, so I would hope that this is merely an intermediate table. But as you said, we have no DDL...
February 18, 2015 at 4:34 pm
dwain.c (2/17/2015)
DECLARE @Account TABLE(AccountNo varchar(3), MasterAccount varchar(10) ) ;
INSERT INTO @Account
SELECT 'ABC','0000000ABC' UNION
SELECT 'DEF','0000000DEF' UNION
SELECT 'ABC','0000000000' UNION ---- unwanted duplicate
SELECT 'DEF','00000' UNION ---- unwanted duplicate
SELECT 'GHI','0'...
February 18, 2015 at 12:21 am
Viewing 15 posts - 316 through 330 (of 3,957 total)