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

    Help on Update Statement

    Here is what I used to update the Cancelled flag when there orders that were cancelled and not re-billed (count is an even number): UPDATE Orders SET o.Cancelled = 1 FROM Orders o INNER JOIN (SELECT a.Order_ID, convert(int,right(a.Order_ID,2)) as Order_End, case when (x.Count % 2) = 0 then 0...
  2. faimuj

    Help on Update Statement

    Hello, I needed some help on how to set records that where cancelled. Here is the table (Orders) and the relevant fields: Orders Order_ID (VARCHAR(25))[/*]Cancelled (BIT)[/*] Using the Order_ID, what I need to do is to find any orders that were cancelled and its corresponding original...
  3. faimuj

    How to update a field while inserting a row

    Hello JarlH, Thanks for your reply. Let's just say I need the firm_code and the firm_id. Since I have not done triggers, would it be possible to show how the sql syntax look like? Also, would two triggers work in this situation? Since firm_id in the offices table is NOT NULL, I'm not sure...
  4. faimuj

    How to update a field while inserting a row

    Hello, I wanted to know what would be the best way to update a field of a row while I am inserting. Here are the tables and fields (for simplicity I am only including relevant fields): • firms ⁃ firm_id (integer, autoincrement, primary key) ⁃ firm_code (varchar(25), internal code) ⁃ name...
  5. faimuj

    Trying to get MIN MAX with CASE statement

    JarlH, thank you very much! The first method worked beautifully! Although, when I tried the second method, it just returned the very large number and did not provide the expected results. Any how, I am grateful for your assistance on resolving this issue. Thanks.
  6. faimuj

    Trying to get MIN MAX with CASE statement

    JarlH, thank you for replying. I tried both ways; however, it id not produce the desired results. If I remove the "else 0," the results returns null not the expected values. Also, I tried "MAXINT." Although, in Sybase (which I am using), does not support MAXINT. Any other thoughts is...
  7. faimuj

    Trying to get MIN MAX with CASE statement

    Hello, I am trying to generate a summary report using various aggregate functions: MIN, MAX, SUM, etc. The issue I have is when I try to get a MIN and MAX of a field when I am also using the case statement. I am unable to get the MIN value of a field when I am using the case statement. I...

Part and Inventory Search

Back
Top