Viewing 15 posts - 586 through 600 (of 898 total)
UPDATE stk_stock
SET STK_P_WGHT_NAME = GETDATE()
FROM STK_STOCK
WHERE STK_STOCK.STK_PRIMARY IN (
SELECT i.STK_PRIMARY
...
December 5, 2011 at 5:50 am
Its just a small change with the alias name. The alias name assigned to the tables, inserted and deleted were the same and they were in s singe derived table.
UPDATE...
December 5, 2011 at 5:44 am
Try changing the '%''' and '''%' in your code to '%'
That should probably make it work..
December 5, 2011 at 5:27 am
Add one more column in your join and the SELECT statement like below
SELECTISNULL(t.id,t1.id) ID, ISNULL(t.region,t1.region) Region, ISNULL(t.Lamt,0) Lamt, ISNULL(t1.lamt,0) lamt
FROM@t1 t
FULL OUTER JOIN @t2 t1 ON t.id = t1.id AND...
December 5, 2011 at 5:09 am
Jeff Moden (11/30/2011)
November 30, 2011 at 6:47 am
Glad I could help you out 🙂
Even you deserve a bit of credit for posting some good test data along with the DDL
Had you not posted the test data, I...
November 30, 2011 at 5:58 am
You will have to maintain a seperate column(like ModifiedDate) and update it through a trigger. There is no other easy way to track it.
November 30, 2011 at 5:21 am
Since you are joining the base table Tbl_Supplier to both Tbl_InvoicePay_Master and Tbl_Invoice_Master, the rows are getting multiplied during the JOIN. Hence, the amount is also getting multiplied.
Check the result...
November 30, 2011 at 5:14 am
You can also use Tally tables for issues like this which will give you better performance compared to Recursive CTE's, Cursors or While loops.
Search for articles related to Tally Table...
November 30, 2011 at 4:37 am
Try changing the INNER JOIN's in your final query to LEFT OUTER JOIN's
November 30, 2011 at 3:46 am
You will have to use a Dynamic Cross-Tab to solve your issue
Go through the article below for more information
November 30, 2011 at 2:43 am
One more option that you can check is the below one
Tools->Options->Designers->Table and Database Designers->Prevent saving changes that require table re-creation
November 29, 2011 at 11:43 pm
This is the only way I am aware of as of now..
DECLARE @datefrom DATETIME
DECLARE @dateto DATETIME
SET @datefrom = '01-Jan-2011'
SET @dateto = '02-Feb-2011'
SELECTCASE
WHEN DATEADD( YEAR, DATEDIFF( YEAR, @datefrom, @dateto ),...
November 29, 2011 at 1:45 am
Please post the DDL and some sample data along with the expected output. This will help people help you faster and in a better manner.
November 21, 2011 at 9:14 pm
This should work for you then..
DECLARE @from_date DATETIME
SET @from_date = '11-Sep-2011'
SELECT CASE
WHEN DATEADD( MONTH, DATEDIFF( MONTH, 0,...
September 28, 2011 at 12:08 am
Viewing 15 posts - 586 through 600 (of 898 total)