Results 1 to 7 of 7
  1. #1
    Braino is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2014
    Posts
    3

    Format error (changes to string undesirably)

    Code:
     Format (((ZSCORE/(SELECT SUM(ZSCORE) FROM [qry_ZSCORE])) * 3900), "#.00")
    Without this formatting i can sort smallest to largest (ideal)
    After this formatting i can only sort A to Z (bad)

    What i really want is to format it as a "Currency" but when i did that it only allowed me to sort A to Z as well.



    Please help, extreme newby.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    The FORMAT function returns (converts to) a String variable.

    What you want is the Format property, not the Format function. You should be able to bring up the Properties of the Field or Control you are trying to apply this to, and change the Format property to "Currency".

  3. #3
    Braino is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2014
    Posts
    3
    Quote Originally Posted by JoeM View Post
    The FORMAT function returns (converts to) a String variable.

    What you want is the Format property, not the Format function. You should be able to bring up the Properties of the Field or Control you are trying to apply this to, and change the Format property to "Currency".
    I need to do it in a query, not manually

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why do you need formatting in table or query? Why not format in form or report?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I need to do it in a query, not manually
    Fields, even calculated fields, in a query have Format properties.
    See here for how to bring that up: http://datapigtechnologies.com/blog/...ousands-place/

  6. #6
    Braino is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2014
    Posts
    3
    Quote Originally Posted by JoeM View Post
    Fields, even calculated fields, in a query have Format properties.
    See here for how to bring that up: http://datapigtechnologies.com/blog/...ousands-place/
    Thanks for the link, that solved my problem, thanks bro!

  7. #7
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Glad to help!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  2. MySQL Syntax Error from Query String in VBA
    By raynman1972 in forum Programming
    Replies: 2
    Last Post: 09-17-2012, 05:59 PM
  3. format text string as date
    By rbrem in forum Access
    Replies: 2
    Last Post: 08-28-2012, 08:39 AM
  4. Check text box string format
    By udik in forum Access
    Replies: 3
    Last Post: 01-04-2012, 01:24 PM
  5. Format within a string
    By wdrspens in forum Reports
    Replies: 1
    Last Post: 04-16-2011, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums