Re: Internation Currency & Number formats



Use Str() instead of CStr() or Format() to generate the decimal value in the
SQL query. The Str() function always uses the "." decimal separator, as does
the SQL, MDX, VB, and most programming/query languages

Tony Proctor

"Antony" <Antony@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2ED5A33C-1F06-4097-8D42-5CFB598435B3@xxxxxxxxxxxxxxxx
> We are building a german version of our english product in VB6 using ado
> connecting to a sql2000 database.
> Most of the sql queries are built on the fly in VB and executed using ADO
> connection.execute method.
> The problem I have come across is that by default setting the country to
> Germany changes the decimal separator from "." to "," so now whereever a
> currency or number with a decimal amount forms part of a query
insert/update
> the query fails because
> of the comma.
> The obvious solution is to perform a replace on the current figures before
> executing the query. Is there a more generic approach? We will probably
> translate our product into many different languages as the need arises so
I'd
> rather put code in place now to handle all the standard formats.
>
> Many thanks for your time
> Antony


.



Relevant Pages

  • RE: Excel & MS Query caused compile errors
    ... My data is in an Excel file called ... The format of it were distorted after copying and pasting. ... Microsoft SQL Server 2000, which requires a server, VBA or Microsoft Query ...
    (microsoft.public.excel.programming)
  • Re: mySQL Problem
    ... And when the query gets executed i get back the following error: ... Actually, problem is proper quoting, not the format or anything else. ... the SQL standard and won't work on any other RDBMS I'm familiar with. ... you admit that mssql uses something DIFFERENT and PARTICULAR to alias? ...
    (comp.lang.php)
  • Re: VBA ADO SQL Query Problem
    ... For long queries on a Oracle DB, I often meke it easy by using Business ... Object where I copy the SQL statement from. ... query parameter in the Oracle date format. ... But the query DID work, only no records were retrieved ...
    (microsoft.public.excel.programming)
  • Re: Format issue ... 2 decimal places displayed?
    ... Jeanette Cunningham wrote: ... to get sql of your query, open the query in design view, then select Query | SQL view from the menu. ... you applied the format to the combo box. ...
    (microsoft.public.access.forms)
  • Re: Noob question - Data Type Mismatch
    ... I am fairly new to SQL and am running into a problem I can't figure ... this is the right place for the query so if not then let me know ... I get a "Data Type Mismatch in criteria expression" error. ... Your non-US format would work with the specific date value you specified because ...
    (microsoft.public.access.queries)

Loading