Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    45

    Question Unanswered: FORMAT numbers in UNION query

    HOW CAN I MAKE MY UNION QUERY TO DISPLAY NUMBERS WITH CERTAIN FORMAT AND RIGHT ALIGNMENT?

    Yesterday I asked how to FORMAT fields in union query and I got a reply from HomerBoo (Thank you very much!) wich helped me to apply the desired format to my field, BUT...
    ... it works fine with text fields or phone numbers, but when the field contains numbers with different sizes it threats them as TEXT and align them left.

    I made a search in the forum and I found that FORMAT function really threats everything as TEXT (at least in union queries). I found solutions when the field should contain date or currency but I still don't know HOW TO MAKE BOTH THE FORMAT AND RIGHT ALIGNMENT?

    Please HELP ME!
    Thank you!

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450
    Format(5459.4, "##,##0.00") ' Returns "5,459.40".


    numbers will normaly allign right

  3. #3
    Join Date
    Jun 2003
    Posts
    45
    in my case it is:

    SELECT FORMAT(Field1, "# - 00") AS ...
    FROM ....
    UNION SELECT FORMAT(Field1, "# - 00") AS ...
    FROM ...
    and it returns something like this:

    23 - 09
    983 - 08
    3 - 21
    9887 - 03

    all this with left alignment. And in my table Field1 is NUMBER not TEXT.

Posting Permissions

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