Commas

  • Thread starter Thread starter Bruce Rodtnick
  • Start date Start date
B

Bruce Rodtnick

I am trying to write a report with a string:

="Milage (" & [Miles] & " @ " & [Rate] & " per mile)"

This should come out on the report as:

Mileage (49,000 @ .31 per mile)

But it comes out as:

Mileage (49000 @ 31 per mile)

with no comma or decimal. The qry is formatted as standard with 0
Decimal Places for the miles, the table stores it as 49,000 but it does
not come out with the comma or the decimal.

Anybody got a way to add these?

Bruce Rodtnick
 
Bruce Rodtnick said:
I am trying to write a report with a string:

="Milage (" & [Miles] & " @ " & [Rate] & " per mile)"

This should come out on the report as:

Mileage (49,000 @ .31 per mile)

But it comes out as:

Mileage (49000 @ 31 per mile)

with no comma or decimal. The qry is formatted as standard with 0
Decimal Places for the miles, the table stores it as 49,000 but it does
not come out with the comma or the decimal.

Anybody got a way to add these?

Try this:

="Mileage (" & Format$([Miles],"###,###.00") & " @ " & Format$([Rate],
"##.00") & " per mile)"

Tom Lake
 
I am trying to write a report with a string:

="Milage (" & [Miles] & " @ " & [Rate] & " per mile)"

This should come out on the report as:

Mileage (49,000 @ .31 per mile)

But it comes out as:

Mileage (49000 @ 31 per mile)

with no comma or decimal. The qry is formatted as standard with 0
Decimal Places for the miles, the table stores it as 49,000 but it does
not come out with the comma or the decimal.

Anybody got a way to add these?

Bruce Rodtnick

I doubt that the table is actually storing the comma (49,000). You are
seeing the comma because the display is formatted to display it that
way.
In any event, when you concatenate the field, format it it at that
time:
= "Mileage (" & Format([Miles],"#,###") & " @ " &
Format([Rate],"#.00") & " per mile)"

Note: You spelled the text as Milage in your sample.
You might want to correct the spelling. ;-)
 
Thanks, both you guys. It works great! I learned something new.

B
I am trying to write a report with a string:

="Milage (" & [Miles] & " @ " & [Rate] & " per mile)"

This should come out on the report as:

Mileage (49,000 @ .31 per mile)

But it comes out as:

Mileage (49000 @ 31 per mile)

with no comma or decimal. The qry is formatted as standard with 0
Decimal Places for the miles, the table stores it as 49,000 but it does
not come out with the comma or the decimal.

Anybody got a way to add these?

Bruce Rodtnick

I doubt that the table is actually storing the comma (49,000). You are
seeing the comma because the display is formatted to display it that
way.
In any event, when you concatenate the field, format it it at that
time:
= "Mileage (" & Format([Miles],"#,###") & " @ " &
Format([Rate],"#.00") & " per mile)"

Note: You spelled the text as Milage in your sample.
You might want to correct the spelling. ;-)
 
Back
Top