all groups > sql server mseq > february 2005 >
You're in the

sql server mseq

group:

Data style?



Data style? Wendy W
2/1/2005 8:39:35 PM
sql server mseq: Hi, I would like to change the data output style
generated from the SQL query. So, how can I go about
doing it? Example : display 59766 as 59,766 and also
datetime as date.

Please help....thanks a lot!

Re: Data style? Wendy W
2/2/2005 4:44:43 PM

[quoted text, click to view]


Thanks, Hugo but my situation is slightly different here.
I'm supposed to display records in a data grip (ASP.NET)
using the SQL statement. I can't format the data grid
column to my desired format, the grid is dynamic.
Therefore I need to format the fields in SQL statement.

Re: Data style? Hugo Kornelis
2/2/2005 10:04:53 PM
[quoted text, click to view]

Hi Wendy,

The formatting of the output of a query is entirely up to the client. If
you access the same data using Query Analyser, Enterprise Manager, Access
and some other tools, you'll already see a variety in formats used, as
each of these tools has it's own defaults.

Best, Hugo
--

Re: Data style? Steve Kass
2/3/2005 1:24:41 AM
Wendy,

You will have to provide the data as character-based data,
preformatted as needed. You could try various solutions such
as these, shown with an integer variable @int and the getdate() function
instead of an entire table::

declare @int integer
set @int = 32476

select parsename(convert(varchar(20),cast(@int as money), 1),2)

select convert(char(10),getdate(),101)
select convert(char(10),getdate(),121)

Steve Kass
Drew University

[quoted text, click to view]
AddThis Social Bookmark Button