this will only work if the string is stored as a translateable string. You can't convert "Hello" to currency. Just keep that in mind.
Second question, No, the '$' is not stored as part of currency.
Currency is a variable type, and determines how the decimal is handled and rounding etc. How the data are presented is not determined by the variable type.
Would like to see this master piece you are building
some VB CODE 101
val([string]) will change the string to number
str([number]) will chnage the number to string
if you are in MSaccess in you querys in the feild line
you can NewFeildName:Val([filename])
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE
how to convert String to Currency, and also, Currency is Standard form (eg 2334.00, NO dollar sign$)
Please let me know, thanks.
Hi. I dont know exactly what you wish to do hoping this will help...
Lets say your in the queries view and theres a column you want to convert into numeric but there might be some ALPHABET value which you cannot convert it....
Assuming table name is TEST and Field Name is FIELD1
SELECT IIF(IsNumeric(FIELD1),VAL(FIELD1),0) AS Output FROM TEST
You can use the combination of IIF function and IsNumeric
I forgot the dollar sign, you can take it off in the Design Mode of your table...
Try to select the Currency Field and change the Format, instead of Currency, try changing it into General Number. It will take off your $ sign.
The currency symbol is specified by your systems internationalisation configuration, so if your computer 'thinks' it is in a dollar country (or hasn't been set up_ it will show a $ symbol. If its incorrect set the symbol via start | control panel | internationalisation
if you don't want a currency symbol: as myle suggests use a general number format. Althgough I'd suggest
NewFieldName:Format([filename],"#,##0.00") will give a currency style formatting.
bear in mind though that if you are displaying currency information that some beancounters get very upset if the totals & subtotals don't tally exactly. so you may need to use something like fix(myvar,nodecimals) to ensure that the sum of the rows equals the total