Which is faster?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wes via AccessMonster.com

    #1

    Which is faster?

    Is it faster to ...

    format the data in the query - then run the report

    or

    run the query - then format the data in the report

    Wes

    --
    Message posted via http://www.accessmonster.com
  • (PeteCresswell)

    #2
    Re: Which is faster?

    Per wes via AccessMonster.c om:[color=blue]
    >Is it faster to ...
    >
    >format the data in the query - then run the report
    >
    >or
    >
    >run the query - then format the data in the report[/color]


    Dunno, but what I read long ago (can't remember the reasoning...) was that
    formatting is best done as close to the end result as possible.
    --
    PeteCresswell

    Comment

    • Larry Linson

      #3
      Re: Which is faster?

      It makes no "sense" to talk about formatting the data other than at the
      point of display. The result of applying a Format statement to a _numeric_
      variable is the text string of characters that you see. It would be
      inefficient, at least in most cases, to store/retrieve the text strings
      representing numbers.

      Larry Linson
      Microsoft Access MVP

      "wes via AccessMonster.c om" <u17141@uwe> wrote in message
      news:5d105f5b29 b10@uwe...[color=blue]
      > Is it faster to ...
      >
      > format the data in the query - then run the report
      >
      > or
      >
      > run the query - then format the data in the report
      >
      > Wes
      >
      > --
      > Message posted via http://www.accessmonster.com[/color]


      Comment

      • David W. Fenton

        #4
        Re: Which is faster?

        "Larry Linson" <bouncer@localh ost.not> wrote in
        news:X_pQf.7588 $wH5.2247@trndd c02:
        [color=blue]
        > It makes no "sense" to talk about formatting the data other than
        > at the point of display. The result of applying a Format statement
        > to a _numeric_ variable is the text string of characters that you
        > see. It would be inefficient, at least in most cases, to
        > store/retrieve the text strings representing numbers.[/color]

        Well, except for cases where you need to operate on the formatted
        values instead of the original. Of course, that would also be slow,
        if, for instance, you're sorting on a value passed through the
        Format() function. But sometimes it is necessary (though sorting is
        not a good example of something that has to be done in the query).

        --
        David W. Fenton http://www.dfenton.com/
        usenet at dfenton dot com http://www.dfenton.com/DFA/

        Comment

        • Larry Linson

          #5
          Re: Which is faster?


          "David W. Fenton" wrote
          [color=blue][color=green]
          >> It makes no "sense" to talk about formatting
          >> the data other than at the point of display. The
          >> result of applying a Format statement to a
          >> _numeric_ variable is the text string of
          >> characters that you see. It would be inefficient,
          >> at least in most cases, to store/retrieve the text
          >> strings representing numbers.[/color][/color]
          [color=blue]
          > Well, except for cases where you need to operate
          > on the formatted values instead of the original.
          > Of course, that would also be slow, if, for instance,
          > you're sorting on a value passed through the
          > Format() function. But sometimes it is necessary
          > (though sorting is not a good example of some-
          > thing that has to be done in the query).[/color]

          For the life of me, I just can't remember a single occasion where I "needed
          to operate on the formatted values instead of the original". I can think of
          some occasions where it would definitely not be beneficial... sorting on a
          formatted number (which, of course, results in a text string) gives you an
          alphabetic sort rather than a numeric one, sorting on Weekday name could
          lead to some interesting sequences, etc..

          Larry Linson
          Microsoft Access MVP


          Comment

          • samwise2u via AccessMonster.com

            #6
            Re: Which is faster?

            So I guess the short answer would be to format data in the report?

            --
            Message posted via http://www.accessmonster.com

            Comment

            • Randy Harris

              #7
              Re: Which is faster?

              samwise2u via AccessMonster.c om wrote:[color=blue]
              > So I guess the short answer would be to format data in the report?
              >[/color]

              I'm not sure there is an answer that is always best. Personally, I do
              computations in the query whenever possible but always do the formatting
              in the report.

              --
              Randy Harris
              tech at promail dot com
              I'm pretty sure I know everything that I can remember.

              Comment

              • (PeteCresswell)

                #8
                Re: Which is faster?

                Per samwise2u via AccessMonster.c om:[color=blue]
                >So I guess the short answer would be to format data in the report?[/color]

                I twist that slightly and say:

                "Format data in the report unless you have a specific need to do it earlier".
                --
                PeteCresswell

                Comment

                • Larry Linson

                  #9
                  Re: Which is faster?

                  "(PeteCresswell )" <x@y.Invalid> wrote
                  [color=blue]
                  > I twist that slightly and say:
                  >
                  > "Format data in the report unless you have
                  > a specific need to do it earlier".[/color]

                  I might go even a bit farther and say "Format the data in the report unless
                  you have a _compelling_ need to do it earlier."

                  Larry Linson
                  Microsoft Access MVP


                  Comment

                  Working...