Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

convert or replace number using .(dot) for decimal to ,(comma)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Evangelos Daflos - 05 Jul 2006 17:35 GMT
there is a field that contains numbers using . for decimal so i need to
create a field that replace . (dot) to , (comma)
the numbers are like 3 not 3.00 or 3.1 not 3,1 or 3.01 not 3,01 so if there
are number without decimal does not present .
in this case i am using the follow query
UPDATE table SET table.field1 = Replace([field1],".",","), table.field2=
Replace([field2],".",",");
but i need to build a command without run that query
Michel Walsh - 06 Jul 2006 23:38 GMT
Hi,

Are you sure this is not simply a question of FORMATTING your number? if so,
your numbers are digitals, not strings, and the update is useless since the
table will revert the string to a digital representation (assuming the field
is numeric).

The Cultural (or Regional Setting) of your PC may asks to display a coma,
rather than a dot, for the decimal delimiter. It is considered to be hard on
the user to not respect his/her preference and to force, say, a US dot
delimiter when the user asks for a coma... Sure, that leads to some
interesting kind of bugs, mainly when you use automatic concatenation :

   str= ".... "  &  floatingPointNumber & "..."

because, in:

   ".... myFunction( "  &   floatingPointNumber &  " ) .... "

a coma will give TWO parameters to myFunction:

   " ... myFunction( 0,5 ) ...."

while a dot will give just ONE:

   " ... myFunction( 0.5 ) ... "

I don't know the whole story of your case, but be sure you don't use Replace
on a FORMATTED, but numerical, field.

Hoping it may help,
Vanderghast, Access MVP

> there is a field that contains numbers using . for decimal so i need to
> create a field that replace . (dot) to , (comma)
[quoted text clipped - 5 lines]
> Replace([field2],".",",");
> but i need to build a command without run that query
Gary Walter - 07 Jul 2006 00:29 GMT
> there is a field that contains numbers using . for decimal so i need to
> create a field that replace . (dot) to , (comma)
[quoted text clipped - 5 lines]
> Replace([field2],".",",");
> but i need to build a command without run that query

try looking at these:

http://groups.google.com/groups?lnk=hpsg&hl=en&q=Declare+Function+VariantChangeTypeEx
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.