Charts - Data Format A97

K

Kahuna

Hi Folks - I have a chart (simple bar chart), and I have a question for the
Chart Guru's!

1.The underlying query for the Chart has the 'Summed' column in 'Standard'
number format with 2 dec places. It shows the correct format when run.

When used in the chart it reverts to its original (table) format of the full
number ('x' dec places).

Is there a reason / work around for this?
 
R

Rick Brandt

Kahuna said:
Hi Folks - I have a chart (simple bar chart), and I have a question
for the Chart Guru's!

1.The underlying query for the Chart has the 'Summed' column in
'Standard' number format with 2 dec places. It shows the correct
format when run.
When used in the chart it reverts to its original (table) format of
the full number ('x' dec places).

Is there a reason / work around for this?

Use the Format() function rather than the Format property. The property never
propagates to other places where the data is used. You might need to wrap the
FormatFunction in CDbl() or CCur() to force the DataType back to numeric after
the rounding.
 
K

Kahuna

Thanks again Rick - is this Format() to go in the actual query or on the
OpenForm action?

I have tried it in the query (Using "Fixed" and "Standard" as the format)
but I get a 'Data Type Mismatch' error if I use the CDbl() as a wrapper and
Invalid Data Type just using Format() plain.

Could you give me an example of using Format() please Rick - with the
relevant expression for the data type?
FYI Here's the SQL:
'***************************
SELECT qryFabricCondition.fc_base_year1 AS [Base Year],
Sum(budget_schedules.bs_m2) AS [Area M2], qryFabricCondition.fc_ccr_value AS
Criticality
FROM qryFabricCondition INNER JOIN budget_schedules ON
qryFabricCondition.fc_id = budget_schedules.fc_fabric_key
WHERE (((qryFabricCondition.ad_analysis_code)>"20"))
GROUP BY qryFabricCondition.fc_base_year1, qryFabricCondition.fc_ccr_value
HAVING (((qryFabricCondition.fc_base_year1) Is Not Null));
'**************************
Cheers
 
R

Rick Brandt

Kahuna said:
Thanks again Rick - is this Format() to go in the actual query or on
the OpenForm action?

I have tried it in the query (Using "Fixed" and "Standard" as the
format) but I get a 'Data Type Mismatch' error if I use the CDbl() as
a wrapper and Invalid Data Type just using Format() plain.

Could you give me an example of using Format() please Rick - with the
relevant expression for the data type?

Format([SomeNumberField], "#.00")

I forgot to mention before that you should be able to apply a format to the
numbers in the chart designer as well.
 
K

Kahuna

Cheers Rick

--
Kahuna
------------
Rick Brandt said:
Kahuna said:
Thanks again Rick - is this Format() to go in the actual query or on
the OpenForm action?

I have tried it in the query (Using "Fixed" and "Standard" as the
format) but I get a 'Data Type Mismatch' error if I use the CDbl() as
a wrapper and Invalid Data Type just using Format() plain.

Could you give me an example of using Format() please Rick - with the
relevant expression for the data type?

Format([SomeNumberField], "#.00")

I forgot to mention before that you should be able to apply a format to
the numbers in the chart designer as well.
 
Top