Re: Formatting data in a SP - Access Format() function replacement

From: simon whale (simon_at_nospam.ukdatait.co.uk)
Date: 04/06/04


Date: Tue, 6 Apr 2004 12:04:52 +0100

Chris

try the following in the query analyser

select convert(varchar, getdate(), 112)

this hsould give you what you are after

Simon
"Chris Strug" <hotmail@solace1884.com> wrote in message
news:u6JI8Q8GEHA.3288@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I have a Sp that returns a recordset which is used as the datasource for a
> form in an Access ADP.
>
> The query itself is fine, however I want to know if it is possible to
format
> selected fields. For example:
>
> SELECT format("yyyymmdd", DateIn) as Date FROM ....
>
> The records are being output to a table (the SP is actually a SE:ECT ...
> INTO) which I then output to a text file using Access "TransferText"
> function so I can't format the data as if it were being fed to controls on
a
> form...
>
> I guess the simple way of putting it is to ask if there is an equivalent
to
> the Access format("format", field) function in SQL Server (2000) that can
be
> used in an SP. I've found "FORMAT_STRING" but it doesn't appear to be what
I
> need...
>
> Any and all advice is gratefully received.
>
> Kind thanks
>
> Chris.
>
>



Relevant Pages

  • Re: Using a stored procedure once
    ... database would no longer be in an appropriate format for them), ... you might as well run the script straight through ... > query analyser. ...
    (microsoft.public.sqlserver.server)
  • Re: Data style?
    ... >you access the same data using Query Analyser, ... I can't format the data grid ... column to my desired format, ... Therefore I need to format the fields in SQL statement. ...
    (microsoft.public.sqlserver.mseq)