Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: format a # returned in a qry

    I would like to format a # using , seperaters, and have 2 decimal points,

    is there a format function and how does it work

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Use the VBA Format function:

    Code:
    Dim myNumberVariable As Single
    Dim MyStrg As String
    myNumberVariable = 5459.4
    MyStrg = Format(myNumberVariable, "##,##0.00")	' Returns "5,459.40".
    See Access Help.....


  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Is it actually a query, or are you dumping this into a form/report?

    There is a "fixed" format available to forms/reports.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Oct 2003
    Posts
    311
    its a query, so i dont think i can use vba, i would use help but the install on this comp is #*()@$ and help often doesnt work

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    In that case, you do need to use the format function. VBA functions ARE generally available within queries.

    Basically you'll end up with:

    SELECT Format([myField], "##,##0.00")
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Jun 2004
    Posts
    96
    Quote Originally Posted by mikezcg
    its a query, so i dont think i can use vba, i would use help but the install on this comp is #*()@$ and help often doesnt work
    format still works in query..
    try it..

Posting Permissions

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