Viewing 15 posts - 1,036 through 1,050 (of 1,923 total)
Or a tweaked version of my above code:
DECLARE @USERNAME NVARCHAR(100) ; SET @USERNAME = N'SABY' ;
DECLARE @USERID INT , @ISADMIN INT
SELECT @USERID = USERID , @ISADMIN = ISADMIN
FROM Table_A
WHERE...
January 20, 2011 at 9:25 pm
Justin 17041 (1/20/2011)
What about this?
Inner Join ProductsON Products.Productname = OrderDetails.ProductName ,
Products.ProductCode = OrderDetails.ProductCode
Remove the , and replace it with AND like this
Inner Join Products
ON...
January 20, 2011 at 10:37 am
Justin, the code that i had given, did u run it without editing anything ? whats the result of that?
January 20, 2011 at 10:31 am
ORDER BY must be present at the last of the code. That is where it should be; so your new code looks like
Select
Orders.OrderDate,
Orders.OrderId,
Orders.OrderNotes,
Orders.Custom_field_vehicleinfo,
Orders.Salesrep_Customerid,
OrderDetails.ProductCode,
OrderDetails.Productname,
OrderDetails.Quantity,
Products.CustomFeild4
From Orders
Join Products
ON Orderdetails.ProductName = Products.ProductName
/* Order BY...
January 20, 2011 at 10:12 am
There is no direct single T-SQL code that can do this requirement, but u still have a cool code to do it. Please go thro this fantastic article from our...
January 20, 2011 at 10:10 am
How about this ?
DECLARE @USERNAME VARCHAR(100)
SET @USERNAME = 'MIKE'
SELECT B.*
FROM Table_B B
JOIN Table_A A
ON A.USERID = B.USERID
AND A.USERNAME = @USERNAME
UNION ALL
SELECT *
FROM Table_B B
WHERE 1...
January 20, 2011 at 7:27 am
Excellent article Gian.. very precise and elegant...
January 1, 2011 at 4:06 am
How many entries per patient ID can hav ? only 2 or more ?
and, do we have a patient IDs stored in the DB sequentially and whats the Primary key...
December 26, 2010 at 10:49 pm
The problem is with your scale and precision of NUMERIC and DECIMAL..
You have given "2004" and NUMERIC (4,2)
DECIMAL (scale, precision)
Scale = maximum number of digits that numeric value can have...
December 23, 2010 at 10:20 pm
There are CAST and CONVERT functions that allow you to convert your VARCHAR functions to TIME format.. Please have a look-see at Books Online (A free help system that comes...
December 18, 2010 at 12:15 am
malavika.ramanathan (12/13/2010)
Hi ColdCoffee,Thanks a lot for your reply. This works fantastically.
I had tried this in a much harder way. Thanks again!!!
Thanks for the feedback , Malavika.. one caveat...
December 13, 2010 at 6:06 am
How about this ?
SELECT CASE WHEN DATEPART( HH , GETDATE()) > 12 THEN CAST ( ( DATEPART( HH , GETDATE()) % 12 ) AS VARCHAR) + ' PM'
...
December 13, 2010 at 5:29 am
terry.davis (11/23/2010)
please disregard this post as i inadvertently hit submit.terry
:-D:-P
November 23, 2010 at 8:11 pm
Update TableA.name column with values from TableB.altname ?
UPDATE A
SET A.name = B.altname
FROM TableA A
JOIN TableB B
ON A.acctno = B.acctno
Wont this do for you?
November 23, 2010 at 8:10 pm
Import all the 8 file into individual tables (dedicate one table to each file , of course), then prepare a "VIEW" to pull the second column of each table and...
November 22, 2010 at 6:43 pm
Viewing 15 posts - 1,036 through 1,050 (of 1,923 total)