Viewing 15 posts - 3,076 through 3,090 (of 3,396 total)
Is that your intended input or output? Either way, in order to help you, please post both. I created a dummy query for the data you provided:
SELECT ...
January 23, 2014 at 2:32 pm
You need a tutorial on basic queries. Most of these are trivial - like the last answer I posted.
If you tested your code, you would know that it wouldn't...
January 22, 2014 at 7:04 am
One way...
CTE??? Isn't that overkill?
create table #tab
(
ref_group varchar(15),
product varchar(10),
qty tinyint
);
insert into #tab(ref_group,product,qty)
values ('Milk Products','Curd',25);
insert into #tab(ref_group,product,qty)
values ('Milk Products','Butter',5);
SELECT ref_group
, product
, qty
FROM #tab t1
WHERE t1.qty = (SELECT MIN(qty)
FROM #tab);
January 21, 2014 at 11:50 pm
Can't you just set the parameter to be multi-valued in the report? Then you can use JOIN() to get the items in the list into a single string...
Or did...
January 21, 2014 at 9:05 pm
Okay. I could get the name of the column outside of the code, but not inside. I'll give it another try and see if I can get closer....
January 21, 2014 at 5:43 pm
Dwain,
cool code! I'll have to dig in and figure out how it works. One thing is missing though... the Symptom name disappeared. The final output should look...
January 21, 2014 at 12:29 pm
Dwain,
cool code! I'll have to dig in and figure out how it works. One thing is missing though... the Symptom name disappeared. The final output should look...
January 21, 2014 at 12:12 pm
"There are multiple categories for each product."
That's unusual. Could you give an example? Normally, you have a category hierarchy (Category, Subcategory...)
January 20, 2014 at 11:38 pm
http://www.manning.com/nielsen/SampleChapter5.pdf
From SQL Server Deep Dives. I think I need to buy this book... <g>
There is also this article...
http://sqlmag.com/sql-server-2012/solving-gaps-and-islands-enhanced-window-functions
using LAG/LEAD. definitely worth a read!
January 20, 2014 at 2:40 pm
I would probably look for an article by Itzik Ben-Gan on it... being that he's a lot smarter than I am.
January 20, 2014 at 2:12 pm
Looks like a running total... if you're using 2012, this works:
sample data setup:
-- create table in tempdb (yes, it probably should have a PK)
CREATE TABLE #pMovement(
pDate DATE,
pallet int,
qty int
);
GO
--...
January 19, 2014 at 8:47 pm
Add a tablix to your layout, then put a rectangle in the cell you want to put these two values in. Then put the two textboxes (for the two...
January 19, 2014 at 6:14 pm
Sounds like a "gaps and islands" question. You're looking for the maximum size of an island.
January 18, 2014 at 8:45 pm
Is the same true if you use a common table expression to calculate the running total?
January 18, 2014 at 5:23 pm
Viewing 15 posts - 3,076 through 3,090 (of 3,396 total)