473,399 Members | 3,038 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,399 software developers and data experts.

Output of a query in row intead a column

2
Hi Friends,
I am googling from last couple of days to find the answer. Below is the problem which I am trying to solve using SQL Server 05,

Col1-------Col2--------Col3
A ....... 1/1/2008.....Y
A ....... 1/2/2008.....N
B ....... 1/1/2008.....N
B ....... 1/2/2008.....N
C ....... 1/1/2008.....Y
C ....... 1/2/2008.....Y

I am trying to capture a following output in a temporary table,

-------------1/2/2008-------1/2/2008
A ............Y.................N
B............ N.................N
C............ Y.................Y

I am trying to solve this problem but could not able to come out with a correct answer. Any suggestions to crack this are welcome.

Thanks in advance

Regards,
bhulok
Feb 18 '08 #1
3 1102
Hi,

Have a look at pivot and cross tab. This article may help.

http://www.databasejournal.com/features/mssql/article.php/3516331

Stu
Feb 18 '08 #2
bhulok
2
Hi Stubailey,
Thank you for a link. I tried Pivot table but it doesn't take characters in 'data field'. I am trying to generate output using sql query.

Regards,
bhulok
Feb 18 '08 #3
ck9663
2,878 Expert 2GB
I don't think it will allow the "/" (slash). You might want to convert the name to COLYYYYMMDD format.

-- CK
Feb 18 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: foldface | last post by:
Hi I have a dynamically constructed sql query that I want to execute, e.g. exec('select * from ' + @tablename) (1) Can I suppress the output somehow if this returns no values? (2) Can I use the...
1
by: joy_julia446 | last post by:
Hi there, I would like to print my result as below in an output file. I would appreciate if someone can give me some advice. RESULT ClassA,96.678,88.196,8.048,-0.233,456.231,5.890, 1...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
8
by: GeorgeSmiley | last post by:
Does anyone know of a way, via VBA, to set the screen position of query results to a particular top, left position? I've glanced at API techniques but cannot find exactly what will do the trick....
1
by: Phil | last post by:
Is it possible to swap rows and columns in select query output so that each record's data is displayed in a column? I want to collect data each day and display it in a query with each day's date...
5
by: Stephen3776 | last post by:
I am doing an inventory control progam and trying to output a multiple array, I am getting an illegal conversion error java.lang.double !d. Can somebody tell me what I am doing wrong or if there is...
7
by: jb1 | last post by:
Hello All, I am trying to create a DTS package. I have two tables tbl_A and tbl_B with similar data/rows but no primary keys. tbl_A is master. I would like this package to query tbl_A and...
3
by: Mo | last post by:
Hi, I am trying to generate an XML output form the database. I am executing select * from Request_vw for xml auto The output data is being truncated. is there a limit on the output result of...
1
by: shlaga | last post by:
Hi, I have query in access that i output in excel and want to graph the output. I have written the code for this in access -> visual basic i want the code to get the range of the xvalues and...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.