|
-
Apr 10th, 2006, 12:45 PM
#1
Thread Starter
New Member
[RESOLVED] How do I filter the dates to generate a monthly report in Crystal Report?
Hi,
Apparently I'm a newbie here and I am also developing a program of my own from scratch so I hope all you experts would go easy on me. Anyway, I'm using VB6 for developing the program, A database created from MS-ACCESS using a DAO connection, Crystal Report 8.5 for designing the report.
In one of my tables(SALES) there's a list of figures and DATES(mm/dd/yy). I was able to generate daily sales reports because I only have to input the specific date under the .SelectionFormula in VB.
code:
.SelectionFormula = "{Sales.DateGenerated} = #" & DTPicker1.Value & "#"
The code on top is part of the code where I'm using the CRYSTAL REPORT control.
Now the biggest problem is that I can't figure out how to filter the dates so that I could get a Monthly Report on a desired Month.
Can someone please help me out of my dilemma? I am desperately in need of help. I am hoping to get a reply as soon as possible.
-
Apr 10th, 2006, 12:56 PM
#2
Re: How do I filter the dates to generate a monthly report in Crystal Report?
Your selection forumula would have be => startdate AND <= enddate
I would use two datepickers for this. Call them dtpStartDte and dtpEndDte
-
Apr 10th, 2006, 02:14 PM
#3
Thread Starter
New Member
Re: How do I filter the dates to generate a monthly report in Crystal Report?
Hmmm, thanks for the reply though. I'll certainly do that. What about a specific month of a certain year?. Still the same thing?
I wanted the program to be more specific though because I designed extra two combo boxes with . one for the month and the other the year, each combo box has data included respectively. For monthly reports, the user will only have to select the desired month and year on those two combo boxes and then click the button View. Will that take a whole lot of work? I hope you could fill me in with more information though....
-
Apr 10th, 2006, 02:16 PM
#4
Thread Starter
New Member
Re: How do I filter the dates to generate a monthly report in Crystal Report?
I really appreciate the reply HACK. I will be waiting for your next reply.
-
Apr 10th, 2006, 02:36 PM
#5
Re: How do I filter the dates to generate a monthly report in Crystal Report?
Crystal has the typical Year and Month functions.
VB Code:
SelectionFormula = "Year({Sales.DateGenerated}) = " & DTPicker1.Year & " And Month({Sales.DateGenerated}) = " & DTPicker1.Month
-
Apr 11th, 2006, 07:48 AM
#6
Thread Starter
New Member
Re: How do I filter the dates to generate a monthly report in Crystal Report?
Thanks for the help Brucevde and also to Hack. I've managed to generate a monthly and yearly report. Thank you both again for the generous and kind help you've given me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|