Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Switch Function (A2K SP1)

    I have a db with several queries but can anyone tell me why a calculated field in one of my queries will format to currency when it's an "Iif (...) statement but won't format at all when I change it to Switch(...)?
    It's a rather long 'Iif ' and I think I read somewhere that Switch is more efficient.
    Peter

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Switch Function (A2K SP1)

    I don't know for certain, but I'd maybe because Switch() returns a variant. You might try wrapping the Switch function within CCur function.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Switch Function (A2K SP1)

    If you want a definitive answer, you'll have to post your Switch() statement.
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switch Function (A2K SP1)

    Mark
    Thanks a lot. That did the trick.
    Peter

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Switch Function (A2K SP1)

    Charlotte
    Thanks for your response. CCur() worked ( see Mark L's rsponse)
    Peter

Posting Permissions

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