Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toughie Question Here....

Status
Not open for further replies.

james0816

Programmer
Jan 9, 2003
295
US
not exactly sure on how to word it but here goes:

i sort my data from a table in the below format:

a b c d
2003 82 46 1
2004 26 36 1
- 24 19 2 <- same yr 2004
2005 66 48 2


Now, I am trying to take it one step further. My new recordset format would look like this:

a b c d e
2003 82 46 1 Y
2004 26 36 1 N
- 24 19 2 N <- same yr 2004
2004 50 55 - Y <- totaling both lines above (would like to be able to add this line to the recordset)
2005 66 48 2 Y

Is something like this possible?
 
ahhh....just did the upgrade to 4.1.12a. this looks to be real tricky

Now I'm getting:

a b c d e
2003 82 46 1
2003 82 46 [NULL]
2004 26 36 1
- 24 19 2
2004 50 55 [NULL]
2005 66 48 2
2005 66 48 [NULL]
[NULL] complete totals on this line

when displaying the data, is it possible to display the one line for the records that only have one entry (i.e. 2003 and 2005) but all the lines for multiples (i.e. 2004)?
 
Possibly but it would be difficult.


My thought at this point is to suggest that you think about separating data storage (and retrieval) from presentation. Formatting the data in the way you wish is feasible in procedural code used to build a web page or a report; or in a stored procedure if you were working with a different RDBMS. But it is really outside the realm of things that can be done with SQL.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top