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

Find dates within a date range

Status
Not open for further replies.

SBpsc

MIS
Dec 1, 2004
50
CA
Hi:

I am using CR XI. I have the following information provided to me: start date (eg: 01/05/06) and end date (eg: 01/08/06).

I need to create a group on the dates that fall within that range, which should then look like:

01/05/06
...
01/06/06
...
01/07/06
...
01/08/06
...

Can anyone tell me how I can create a group that would generate the dates within my given range.

Thanks in advance.

 
Groups are based on the data in your database, not on parameters or information provided to you.

So if you need to demonstrate all dates within a range I would suggest taking the Data Warehousing approach demonstrated in my FAQ:

faq767-4532

It includes the T-SQL for SQL Server to get it set up, and it's pretty generic so you can use it for other databases as well.

There are workarounds for doing this in Crystal, so it you can't create database tables let me know.

-k
 
Thanks for the information, however, I can't create database tables. We have a set number of tables and the date range will change based on the company and the person who is using the report, etc, etc...

So, if you let me know the Crystal workaround, that would be great.

Thanks,
SB
 
You could link to some record that is produced every day. Or make an issue of it with whoever does create database tables: a list of dates is a basic need.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc. Thats pretty much the way I am moving forward with this. We have a list of months in our database already which I cross join with this year, this year - 1, and this year + 1 and convert them to dates in the format (yyyy, mm, 01) for other calculations. What the table is missing is a list of days. I am going to request that they put in a list of numbers in the database which I can then use to make real dates.

Thanks for the advice.

- SB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top