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!

Printing a Monthly report for historic data

Status
Not open for further replies.

Greeneyes

Programmer
Jul 30, 2002
9
0
0
GB
I'm trying to print a report based on the previous month's results.
The report should look something like this.

DAY Column
1 10.30
2 200.70
3 300.10
..
31 40.90
total (1..31)


It needs to find the last historic entry created for that object on that day and so.

The record selection is based on recordtime. (needs to take into account months with 30 days etc.. If no entry is found for a date we need to default 0.

Thank You in advance
 
Hi,
What have you tried?

Do you want data from the previous month ( that is, if run in March then use Feb. data ) or data from last 30 days?

What is the srructure of your data tables?
What database?
What version?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
I've various things, new to this.

Using crystal reports X1.

 
Hi,
I've tried various techniques, I'm new to this.

We are Using crystal reports X1.

 
Hi,
OK, we were all new once..You did not answer my other questions:

What database?
What version and connectivity type?
and, especially,:

Do you want data from the previous month ( that is, if run in March then use Feb. data ) or data from last 30 days?

and
What is the structure of your data table(s)?






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,

I'm using SQL database as the back end and crystal x1.

Yes need the data from the previous month.

for each item a record time and value is stored.(primary ket being record.id)

Does this help?
 
Hi,
OK, progress..

What are the fields/data types in the table?

Is the record time in a DateTime field?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
Yes recordtime is datetime,
value as integer
etc..

Do i need to create subreport for each day or use formula's

Must remember that the number of days vary for months ie, 30, 31 etc..

Cheers...
 
Month({your.date}) will give you a number, 1 to 12. And Year({your.date}) would give you the year. So you can select dates based on a calendar month without worrying about the lenght of the months.

There's also DatePart, useful when you want something other than a month or year.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top