Re: Missing Format() - Function



On Fri, 15 Apr 2005 01:33:00 -0700, nieurig wrote:

>Hi folks,
>i have to translate SQL-Statements from Access 2000 to SQL
>Server 2000. There was a lot of Access-Functions used
>(mid, str, iif ...) and i convert them to SQL-Server
>Syntax, but i dont found a way to simulate the results of
>the Format-Function with was used for numeric data
>as "##0.##" or "##0 %" and so on ...
>
>What is the best way to substitute the FORMAT() function
>at SQL Server?
>
>Thanks for any help.
>Niels

Hi Niels,

The best way is to return unformatted data to the client and let the
client handle the formatting. Formatting is not a task that the server
is ideally suited for.

If you must do it at the server, then start by looking into functions
such as CONVERT, CAST and STR. If they don't do what you need, then post
some examples of unformatted data and how you want it to look, so that I
(and others) can look into it and try to come up with something.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
.



Relevant Pages

  • Re: FTP Tagging anyone?
    ... > secured against various different kinds of vulnerabilities, ... formatting the system is probably not necessary. ... baseline server looks like, so they can't tell what is and isn't suspicious ... this depends on your security needs. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Set based solution
    ... There are two major arguments, at least in my mind, against doing reporting ... The server has very finite limits on the resources ... hundred boxes doing formatting locally rather than a single box doing the ... SQL, and T-SQL, is not a general purpose programming language. ...
    (microsoft.public.sqlserver.programming)
  • Re: Set based solution
    ... coding off the database server, then it is worthwhile doing it. ... I'd argue that formatting things that differ from country ... > And SQL IS a data manipulation language, hence my problem with not using ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL question
    ... In this specific case, let your database layer fetch the data, and then use ... your presentation layer for formatting that data and displaying it the way ... server to client - that's always a "good thing" to do. ... you need to use SQL Server's SUBSTRING method - look it up in SQL ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Where can I set the output format of a database date field ?
    ... This date that you are displaying, is this the System Date or the SQL date? ... i.e. are you using or Select GetDatewith formatting? ... The first one I believe uses the regional setting, ... Options->Customize of the Server and the Workstation and also ...
    (microsoft.public.frontpage.client)