Re: Missing Format() - Function



On Sat, 16 Apr 2005 00:30:57 -0700, nieurig wrote:

>good morning hugo,
>thanks for your comment.
>
>>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.
>
>Well i have to format the results, because the code of the
>given application was lost and i translate the sql-
>statements coming from a textfile.

Hi Niels,

I might have misunderstood you. I thought you wanted to find a way to
control the format used for outputting numeric values from SQL Server,
but now I'm starting to think that you need to do the reverse: read in a
file with formatted results and make sure that they are converted to the
correct numeric values by SQL Server.

But maybe I am still misunderstanding you?


>>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,
>I use them for formating datetime values. It works well
>but at numeric data the results a not good. therefore i
>start to write a serverside function. I will post the code
>if it was ready.

Yes, you can do that. Or you can post some examples of typical data in
input / output pairs, to help me understand what exactly you need to get
done. I can only try to help if I know what you're trying to achieve,
and frankly, I don't know right now. Since I don't know what Access'
FORMAT() function does, you'll need to teach me (by example) - then I
can try to find a way to mimic this in SQL Server.

Best, Hugo
--

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



Relevant Pages

  • Re: mm/dd/yyyy format question
    ... I was not talking about how .Net or SQL Server stores date/time values ... I get the impression that you are talking about ISO 8601 in terms ... applications use the format for unambiguously representing date/time ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help with dates format to 20040401.
    ... Keep in mind that date formatting is generally the job of the client ... not SQL Server -- SQL Server simply gives the client the data; ... You can convert the date type to a character type and then ... apply styles to get the appropriate format. ...
    (microsoft.public.sqlserver.programming)
  • Re: formatting to 2 decimal places
    ... You have to differentiate between a value and the representation of that value. ... client application and the client application format that in a human readable format. ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Querying on dates in dd/mm/yyyy hh/mm/ss format using Access2002 And SQL Server 7
    ... For parsing a string to a date/time, the 103 format doesn't limits the user ... > which is used as the row source for the results form). ... > other solutions assuming I have to use SQL Server 7? ... > I don't understand how I can use parameterized stored procedures to solve ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Moving a VBA function to SQL server
    ... "String Functions " in Books Online. ... The SQL server database contains a table named 'WorkOrders'. ... This will produce a job header formatted like this: ... The format he specifies is stored in table 'Settings' - field 'JobHdrMask' ...
    (comp.databases.ms-access)