format in SQL queries

  • Thread starter Thread starter Doo-Dah Man
  • Start date Start date
D

Doo-Dah Man

I have a form that creates a SQL SELECT statement using variables
populated by a couple combo boxes on a form. The query is recreated
using VBA each time the form runs. Is there a way to format the
fields used in the query via SQL? There are some currency values that
I want formatted accordingly. Since the query is deleted and
recreated each time the form runs, I can't set the properties in the
Design view of the query. I was hoping there's a way to do it in VBA
where the SQL gets written.

Thanks for any help!
 
If the query is only for viewing (not update), just use the Format()
function to get whatever format you want for each column.

So instead of:
SELECT MyAmt, ...

use:
SELECT Format(MyAmt, "...."), ...

Check out Format in online help.

HTH,
TC
 
Back
Top