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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting 2 table fields into 1 consolidated report field

Status
Not open for further replies.

zimmer9

Programmer
Jan 12, 2005
66
0
0
US
I have a table that has the following 3 fields
(type, shares and amount) as follows:

Type Shares Amount
---- ------ ------
values: C 10.00
C 20.00
S 800.00
S 900.00
-------------------------------------------------------

My goal is to create a report that shows the following:
The user wants to see these heading across the top of the page and the detail records running down the page.

Type Shares/Amount
--- -------------
C 10.00
C 20.00
S 800.00
S 900.00

Is there a way though SQL (or a Report feature) that I can create (in the query grid of a Report) 1 field named Shares/Amount that combines the values from the 2 separate table fields named Shares and Amount ?
 
Is it correct to assume that one of the Shares or Amount fields is always null? Meaning, either you have an entry for one or the other, but never for both?

If so, it's pretty simple. Base your report on a query that includes the following calculated field:

SharesAmount: =nz(shares,amount)

see if that works for you. If the logic is more comlpicated, you'd follow the same idea, but you'd have to use a more complex function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top