Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. wexas45

    Allocate 0 or 1

    thanks for your reply, is there way that i can do this without inserting into a new table?
  2. wexas45

    Allocate 0 or 1

    Good Morning All, Test Table Booking Ref No: Booking Ref No 1 L01 1 L01 0 L01 0 L02 1 L03 1 L04 1 L05 1 L04 0 Can anyone kindly assit me on this. I have column on one of my tables with...
  3. wexas45

    COALESCE

    Hello All Can you kindly advice what is wrong with this statement COALESCE (SUM(Cost)) AS Cost, I am getting this error Msg 102, Level 15, State 1, Line 11 Incorrect syntax near ')'.
  4. wexas45

    CASE STATEMENT

    Hello All, can you please help. I am trying to display margin as 0.00 if [GrossProfit] = 0 if not then do the calculation. thanks in advance SELECT *, CASE WHERE [GrossProfit] <> 0 THEN (CONVERT(DECIMAL(17,2),([GrossProfit] / NULLIF(Price,0) * 100.0))) AS Margin ELSE...
  5. wexas45

    Calculate Margin - Group

    Hi, Question in the code you have written X at the end. What is the purpose of that and one more question some of the results are showing value as null how can i display 0.00 ? Thanks in advance
  6. wexas45

    Calculate Margin - Group

    Thanks it works perfectly fine
  7. wexas45

    Calculate Margin - Group

    I used your suggestion
  8. wexas45

    Calculate Margin - Group

    Hello Markos, thanks for your reply but i am getting this erros Msg 207, Level 16, State 1, Line 1 Invalid column name 'Gross Profit'. Gross Profit is not the column from the table but it's a calculated one. Appreciate your time Regards WEXAS
  9. wexas45

    Calculate Margin - Group

    Hi, hope every one is doing well. I am new to sql queries. I need to calculate 'MARGIN', which is 'GrossProfit'/[price]*100 and then display the reuslt in the query. Can someone please help me ! SELECT [Booking Product], YEAR([Booking Conf Date]) AS 'BookingYear', COUNT(DISTINCT...

Part and Inventory Search

Back
Top