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!

Results from past dates

Status
Not open for further replies.

humbletechie

IS-IT--Management
May 3, 2001
33
US
Hello

Is there a formula I can use that will give me results from past dates? I need qty shipped on items for last week, 2 weeks ago, 3 weeks ago, 4 weeks ago, 5 weeks ago and 6 weeks ago. I need all of these to be in a seperate field like below.

Item # last week qty 2 weeks ago qty 3 weeks ago qty

I am new at Crystal Reports so any help would be GREATLY appreciated.

Thanks in advanced!

 
You can use a cross-tab by week.

Or you can use conditional columns, writing a formula for each week column. Conditional columns are described in my FAQ on common formulas. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks for your response! I think I am going to use conditional columns but I am still stumped on how the formula should go. I need the weeks to be from Sunday thru Saturday. I was thinking DateAdd ("d",-7 #5/9/2001#) with 5/9/2001 being whatever todays date is but that will not give me Sun thru Sat. Does anyone have an example formula?

Thanks!!
 
The following formula will show you how to peg a certain day of the week:

CurrentDate - DayOfWeek(CurrentDate)

This will give you the Prior Saturday, regardless of what day you run it. Subtract another 6 from that and you get the Sunday before that. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top