473,387 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help needed for Data formatting.

Hello all,

I just started using SQL to create a report. I got the syntax working
but I have absolutely no idea of how to format data. Can anyone kindly
look at my code and help me? I thank you in advance.

Details:-

The code:

SELECT Column1, Column2, Column3
FROM WORKSHEET

Output:
Column 1 Column2 Column3
23.00 a 23a
23.00 b age2

The output I want:
aCol1 aCol2 aCol3
23 a 23a
23 b age2

NOTE: the column headings have to be bolded.

In conclusion, the following is what I want:
.. the column data should be centered
.. how to change column headings and make them bold
.. the numeric value should be set as integer value (i.e. 12) instead
of default double value (i.e. 12.00)
Jun 30 '08 #1
1 1268
SQL Server is not the correct place to format your result set. Formatting
belongs to the client interface.

For the DECIMAL values you can CAST to INTEGER:

SELECT CAST(column1 AS INT);

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jun 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: William Gill | last post by:
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql=...
1
by: ric.castagna | last post by:
Greetings, all... I've got an issue that I'm trying to solve and RegExp looks to be my only avenue. Background: We are using a popular third party control for input into a textarea. By...
4
by: Wayne Aprato | last post by:
I have a simple database which was originally written in Access 97. When converted to Access 2000 file format it ran flawlessly in Access 2002. I've just tried to run it in Access 2003 and I am...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
13
by: Alan M Dunsmuir | last post by:
I need to specify a new data type, almost entirely a 'clone' of the existing DateTime type, with the following specific difference, and all the consequent differences in properties and methods...
2
by: serge calderara | last post by:
Dear all, I have an ASP.NET 1.1 application which show data collected from an sql database inside a datagrid bind to a dataset which contains all data retrive. I need to display ki^nd of...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: Melissa | last post by:
I currently have VBA written to export query results into an Excel file. That file is then formatted using the code below. The problem I'm having is that it keeps throwing Error 91 (Object...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.