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!

Different Selections

Status
Not open for further replies.

SAWB

Technical User
Jan 11, 2001
26
I have a simple access database with fields such as invoice date, invoice amount, etc. How can I select data for different years (1999, 2000) on the same report?

EX:

Cust # 1999 Sales 2000 Sales
11111 1234.78 5678.90
 
You should be able to use formula fields in place of direct data fields.

Say your table is set up with customer_no, datefield, and sales.

You would create a formula called '1999 Sales' which is defined as
"IF {datefield} = '1999' THEN {sales}".

You would also create a formula called '2000 Sales' which is defined as
"IF {datefield} = '2000' THEN {sales}".

You then set up your report with the formula fields rather than the actual "sales" fields.

Cust # 1999 Sales 2000 Sales
<customer_no> <1999 Sales> <2000 Sales>
 
In some cases you can simply cross-tab with the date as the column field. Make sure that you set the cross-tab group options for the date field to be &quot;for each Year&quot; or you will get a column for every day.

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top