Viewing 15 posts - 631 through 645 (of 683 total)
There are a few methods - none of which is that straightforward, but do the job. I've used one method as an example below ![]()
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Once you've got your 1 column table to SQL, you can try a variation of this kind of thing (just try running it and you should get the idea Ryan Randall Solutions are easy. Understanding the problem, now, that's the hard part.
Hi all,
I started playing with the PARSENAME way of doing this (for fun, and taking into consideration what's been mentioned), and got a bit carried away.
I'm not certain it...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
This kind of thing has been discussed many times before on here. Here's one simple way (as an example)...
CREATE TABLE #T1 (name SYSNAME, par INT IDENTITY(1, 1))
INSERT INTO #T1...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Unless there's more to the problem than you've described, I'd solve it using VBA, rather than T-SQL (in which case this is the wrong forum, so apologies).
Something along the lines...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Just working on that now...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Galahad,
Ray's right that you need to post more information about your problem. How do you know, for example, that rows 1, 3 and 5 (or 2, 4 and 6) in your...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
I see paramind - that's what you're thinking. In that case, I guess changing...
INNER JOIN (SELECT s1.Orderref, SUM(ISNULL(s2.Quantity,0)) AS [Summ]
...to...
INNER JOIN (SELECT s1.Orderref, SUM(ISNULL(s2.Quantity,0)-ISNULL(s2.[Scheduled Amount],0)) AS [Summ]
...might do...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Well, I prefer David's method. A little tweak to seems (to me) to meet all the requirements (including the priority one)...
SET @Material = 'MATERIAL1'
SET @Qty = 350
UPDATE a
SET a.[Scheduled Amount] =...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
I think the '<=' should be a '>=', but Sergiy's solution is a good one. ![]()
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Viewing 15 posts - 631 through 645 (of 683 total)