Forum Replies Created

Viewing 15 posts - 1,036 through 1,050 (of 1,923 total)

  • RE: CONDITIONAL WHERE CLAUSE

    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...

  • RE: Why Doesnt This Work?

    Justin 17041 (1/20/2011)


    What about this?

    Inner Join Products

    ON Products.Productname = OrderDetails.ProductName ,

    Products.ProductCode = OrderDetails.ProductCode

    Remove the , and replace it with AND like this

    Inner Join Products

    ON...

  • RE: Why Doesnt This Work?

    Justin, the code that i had given, did u run it without editing anything ? whats the result of that?

  • RE: Why Doesnt This Work?

    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...

  • RE: Combine Multiple rows into 1 row

    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...

  • RE: CONDITIONAL WHERE CLAUSE

    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...

  • RE: Understanding T-SQL Expression Short-Circuiting

    Excellent article Gian.. very precise and elegant...

  • RE: SQl query help

    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...

  • RE: Conversion Issue-varchar to data type numeric

    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...

  • RE: TIME CALCULATIONS

    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...

  • RE: Displaying time in 12 hour format

    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...

  • RE: Displaying time in 12 hour format

    How about this ?

    SELECT CASE WHEN DATEPART( HH , GETDATE()) > 12 THEN CAST ( ( DATEPART( HH , GETDATE()) % 12 ) AS VARCHAR) + ' PM'

    ...

  • RE: update table with multiple values from another table - all data to be on same row

    terry.davis (11/23/2010)


    please disregard this post as i inadvertently hit submit.

    terry

    :-D:-P

  • RE: update table with multiple values from another table - all data to be on same row

    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?

  • RE: Combine multiple files

    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...

Viewing 15 posts - 1,036 through 1,050 (of 1,923 total)