Results 1 to 5 of 5

Thread: Strange Access 2 Delete Query

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45

    Strange Access 2 Delete Query

    I'm in the process of converting an old Access2 database to SQL server 7 and have come accross this query :

    DELETE DISTINCTROW BOTrans.gl_tran_code, BOTrans.MatTest
    FROM BOTrans
    WHERE ((BOTrans.gl_tran_code) In ('stoki','stokr','stokx','wrton','tfer',"gjnl","jnal","jnye","jnye2","jnye3"))

    It LOOKS like the person that wrote it was trying to delete only certain fields from the table, which I would normally use an update query for. Can anyone tell me if this delete query is (was)actually valid and if so what would it do ?

    Thanks in advance
    Ian.
    Ian Clarke BSc (Hons) - Web Applications Programmer
    Ricardo Consulting Engineers Ltd.
    Email : [email protected]

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Not come across that before.


    Sorry


    Looks vaguely liike Business Objects though.

    Perhaps it was meant to delete the rows where the code matches those in that list... For what reason - only the original developer knows and they have probably forgotten by now


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45
    This is the line that really gets me : DELETE DISTINCTROW BOTrans.gl_tran_code, BOTrans.MatTest

    Ignoring the DISTINCTROW for a moment, Delete dose'nt usually take any parameters does it ? So why have two field names afetr the delete command ? I know it's an Access 2 database, just can't find any reference to using delete in that way.
    Ian Clarke BSc (Hons) - Web Applications Programmer
    Ricardo Consulting Engineers Ltd.
    Email : [email protected]

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I did a search, which may prove to be eventually useless, but worth the click.

    http://www.mvps.org/access/queries/qry0022.htm
    http://support.microsoft.com/support.../Q168/4/38.asp

  5. #5
    Addicted Member
    Join Date
    Feb 2002
    Location
    Belgium
    Posts
    190
    wath a streange code

    it certainly will not work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width