Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update query to exchange 2 fields (2000, 2003)

    Hi All,

    I have a table with these two fields:

    artWidth
    artLength

    What I need is an update query that swaps artLength and artWidth if artWidth > artLength
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update query to exchange 2 fields (2000, 2003)

    Hmm. Tried a bit on my own and came up with:

    UPDATE tblArtArtikel SET tblArtArtikel.artLength = [artWidth], tblArtArtikel.artWidth = [artLength]
    WHERE (((tblArtArtikel.artLength)<[artWidth]));

    Is this OK?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update query to exchange 2 fields (2000, 2003)

    Yes, that should work.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update query to exchange 2 fields (2000, 2003)

    Yep, thanks.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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