Stored Procedure Query Report and Display Horizontally

Hi everyone,

I need help with my sql report generation.

please refer to the screenshot below.

Table 1 - This is my actual db table.

I want to create a report that will display the items horizontally (please refer to Table2 - Report / Screen Output).

Thanks,

What if there are two HDs or three monitors? What would it look like then? What if there are two computers?

Hi gbritton,

HARD DISK, MEMORY, MONITOR, CPU CASE and OTHER are my categories.

Whenever the user adds an item, they will need to select under what category the items belongs to.

so if there are multiple items, the report that i want will be like this :slight_smile:

HARDISK | CURR | EXRATE | TYPE | MEMORY | CURR | EXRATE | TYPE | .....
120 - USD - 1.33 - PREPAID - 200 - USD - 1.44 - PREPAID....
300 - USD - 1 - CASH - 120 - USD - 1.44 - CASH...
150 - USD - 1.35 - CASH - 200 - USD - 1.44 - CASH ....
220 - USD - 1.32 - CASH - 200 - USD - 1.44 - CASH ....

hello everyone,

any idea how to present the report horizontally?

thanks

If you just want one text line per PC, FOR XML PATH('') will do it
If you want multiple columns instead, you'll need dynamic SQL.

How would you like it?

hi,

I want it in multiple columns. how can I do it?

to start please post

CREATE TABLE statement
INSERT INTO statement to populate sample data