User Profile

Collapse

Profile Sidebar

Collapse
Ample
Ample
Last Activity: Jan 24 '09, 02:12 AM
Joined: Oct 20 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Ample
    replied to Delete Statement
    What through me off was the first optional keyword "from". Got r done.


    Code:
    DELETE InvOnhand
    FROM InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
    WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007
          and NOT (InvOnHand.partno in (partlist)
    See more | Go to post

    Leave a comment:


  • Ample
    started a topic Delete Statement

    Delete Statement

    I need a delete statement to delete records using the below select statement. I got a mind block as to what should be used in the where clause column operator.

    Code:
    DELETE from InvOnHand
    WHERE [I]<unknown column operator>[/I]
    (SELECT InvOnHand.*
    FROM   InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
    WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007 and NOT (InvOnHand.partno
    ...
    See more | Go to post

  • Thanks CK for the tips! I moved the temp table out of the While loop and added
    Top 1 to my select statement (SELECT DISTINCT Top 1 @partno = [partno] FROM #PartNoList ORDER BY PartNo). I also moved the last select statement out of the BEGIN...END block (SELECT partno, OHlot, OHqty, PHlot, PHonhand
    FROM #ScanData) to achieve the desired result.

    Regards
    See more | Go to post

    Leave a comment:


  • Ample
    started a topic Not getting require result from Store Procedure

    Not getting require result from Store Procedure

    I created an SP to query a temp table for a list of part numbers. The part number list would be used in a WHILE loop to return a record set of each part number row.
    The part number list has 2 part numbers. The last part number is the only part number being returned.

    Any help would be greatly appreciated.

    Code:
    CREATE PROCEDURE [dbo].[sp_Ample_TEST] AS
    
        BEGIN
        CREATE TABLE #PartNoList
    ...
    See more | Go to post

  • Ample
    started a topic Inserting Option Button Group Values into SQL server

    Inserting Option Button Group Values into SQL server

    This is what I'm trying to do. I created a form for a user to enter a name. The information is saved in SQL DB employees table. The employees table auto number is assign to global variable GBL_ID as shown is first code. By clicking the proceed button on the first form I can follow the GBL_ID variable to the second form in debug mode.

    While hitting F8 I can follow the process until a I get an error message:
    Object variable or...
    See more | Go to post

  • Ample
    started a topic Accessing specific records

    Accessing specific records

    I use Crystal Reports 10.0 for report writing accessing MS SQL 2000 database. Let me explain using an example.
    I want to query the DB for 200 part numbers. I will sum the inventory on-hand to compare to the quanity on-order for a given sales order. As the inventory on-hand compares to quanity on-order as soon as I get the first negative inventory on-hand balance I want to report that record only. The information I would like to bring forward...
    See more | Go to post
No activity results to display
Show More
Working...