Results 1 to 5 of 5
  1. #1
    keith2511 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Location
    UK
    Posts
    45

    Formatting the total column of a crosstab


    I want to format the total column of a crosstab query as currency. The other columns have formatted as currency but not the total.

    Code:
    TRANSFORM Format(Sum([Temp_Import].VAT_Amount),"Currency") AS SumOfVAT_AmountSELECT [Temp_Import].Caterory_Final, Sum([Temp_Import].VAT_Amount) AS [Total Of VAT_Amount]
    FROM Temp_Import
    GROUP BY [Temp_Import].Caterory_Final
    PIVOT Format([Invoice_Date],"yyyy-mm");
    Grateful for advice.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Just set the Format property for the field in query design view. Did you do that for the other field to set its format?
    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.

  3. #3
    keith2511 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Location
    UK
    Posts
    45
    Hi June,

    I couldn't get the FORMAT function to work in design view, so I edited the SQL. I've just tried to format the Total column in design view but no matter how I edit the Total column, I get an error such as
    Click image for larger version. 

Name:	Capture181123.PNG 
Views:	8 
Size:	21.0 KB 
ID:	36302

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Interesting, my suggestion worked for me.
    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
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by keith2511 View Post
    I couldn't get the FORMAT function to work in design view, so I edited the SQL.
    Your screenshot shows a field name [ VAT_Amount] with a space at the start. No such field exists hence the error
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Total bar in a Crosstab query
    By djclinton15 in forum Queries
    Replies: 8
    Last Post: 08-31-2017, 02:26 PM
  2. Display Total Row in Crosstab Query
    By zashaikh in forum Queries
    Replies: 3
    Last Post: 03-21-2017, 09:07 AM
  3. Crosstab Query with Percentages of Total
    By McArthurGDM in forum Queries
    Replies: 4
    Last Post: 05-07-2015, 02:48 PM
  4. Replies: 1
    Last Post: 07-05-2012, 11:34 AM
  5. Replies: 5
    Last Post: 09-10-2010, 10:07 AM

Tags for this Thread

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