Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query for Multiple Formats

Status
Not open for further replies.

jdd3110

MIS
Dec 11, 2003
18
US
I am trying to update an Access field for pricing for a quote log. Some of the records have the price quote and some have NQ for "No Quote" I would like to make the records that are a numeric value appear as currency and leave the "NQ"s as text. Is this possible?????
 
If some of your records contain the string "NQ" then I infer that the field is a text field even though other records contain a text string that looks like a number. You can, in a query, produce a result that does what you want with the construct
Code:
Select ..., IIF(QuoteField = "NQ', QuoteField,
                Format(Val(QuoteField),"$#,###.00")) As [Quote], ...
That should produce records that appear like
Code:
 Quote
Code:
 $1,234.56
 NQ
 $345.67
Note that you will not be able to actually use those values as numbers because they are really character strings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top