List Box Question (1 Viewer)

jcruzAME

Registered User.
Local time
Yesterday, 20:36
Joined
Oct 5, 2011
Messages
135
I have a query that populates a list box. In the query (and all other queries associated with it) I have a column set to currency with 0 decimal places. The SQL back end column these pull from is data type decimal with a scale of 0. No matter what I do though, it always shows up in the list box with .00. Is this just a list box thing?
 

MarkK

bit cruncher
Local time
Yesterday, 18:36
Joined
Mar 17, 2004
Messages
8,199
I don't know about SQL Server, but in Jet (Access) SQL you can use VBA type conversion, or Format(), functions in the query to refine what and how data is returned from a field in a table, so consider...
Code:
SELECT [COLOR="DarkRed"]Format(CLng(Round(MyCurrencyField, 0)), "#,###,##0")[/COLOR] As MyHeavilyReformattedCurrencyField
FROM MyTable
WHERE ThisIsCool = True
That's overkill. Probably just one of those would work, but you get the idea. :)
Mark
 

Mimadocken

Registered User.
Local time
Yesterday, 20:36
Joined
Mar 12, 2012
Messages
81
This is probably a "Newbie" answer, but I thought the Currency format always came with 2 decimals (especially if the type of currency uses them.) So, I think you are trying to make the format do something it was intended to avoid.

Do you NEED to have it formatted for currency? Otherwise, you can format it for a number without any decimals and place the currency symbol for that type of currency on a label next to the form field that returns the amount.

Just my two cent's worth.

Good luck.
 

Users who are viewing this thread

Top Bottom