Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jgandara
Starting Member
18 Posts |
Posted - 2005-03-14 : 14:01:07
|
| I have to print an invoice and I need to select 12 rows at a time. So if the original invoice has 3 rows of detail, I need to have 9 more of empty values. For example:Desc Qty AmtDetail1 2 3Detail2 1 5<PaddedRow> 0 0<PaddedRow> 0 0....12 in total.I'm creating the invoice in crystal reports and I don't see a way to do it there. I'm connecting to an iSeries database, so I can't use store procedures, just plain SQL.Thank you |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-03-14 : 14:36:01
|
| Can you use a UNION?SET ROWCOUNT 12SELECT Desc, Qty, AmtFROM MyTableWHERE InvoiceID = 1234UNION ALLSELECT NULL, NULL, NULLORDER BY CASE WHEN Desc IS NOT NULL THEN 1 ELSE 2 ENDSET ROWCOUNT 0Kristen |
 |
|
|
|
|
|