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!

Week parameter from previous full month

Status
Not open for further replies.

crystaldev1

Programmer
Nov 6, 2003
232
US
Hello, I'm using CR2008 and Sql Server.

I have a report with records from last full month. I need to create a parameter that will ask for a week from last full month. Thanks.
 
If the parameter selected weeks 1, 2, 3, 4, 5 or even 6 from the previous month, Crystal could work out what dates those would be. "Week" might be either calendar week or 7-day period starting from the 1st of the month.

If you want the week to be identified by its dates in the parameter, you could do this with a new table on the database (if allowed) or with a linked Excel spreadsheet that would need monthly updates. (That could even use data generated by another Crystal.)

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Thanks for your suggestion.

This is what I have in the record selection. {abc.date} in lastfullmonth. So I am selecting month of data in the report. I need a parameter that would ask for which week for the month and the user should be able to select and see only the data for that week. I'm not sure how I could do this without creating another table or spreadsheet. Thanks.
 
Use a record selection formula like this:

month({Orders.Order Date}) = {?Month} and
{@weekofmo}={?Week}

...where {@weekofmo} is a formula like this:

Datepart("ww",{Orders.Order Date})+1
- Datepart("ww",({Orders.Order Date}-Day({Orders.Order Date})+1))

This assumes a week starting Sunday.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top