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

Another Date format question. CR 9.0

Status
Not open for further replies.

Digitalcandy

IS-IT--Management
Joined
May 15, 2003
Messages
230
Location
US
I have a "On Time Delivery" chart that uses a date field. Currently I have the date field, (X axis) set to "weekly". When a person runs the report for a whole year the weekly axis kind of becomes useless and I'd rather it be Monthly. I've made a formula for the chart to dynamically change but I'm stuck on how to make the date weekly. Below is my code so far;

{@OTDforChart}

IF Maximum({?DateRange}) - Minimum({?DateRange}) < 241
THEN ToText({_PCIview_Ship.ShipDateTime}, "yyyy/MM/ww")
ELSE ToText({_PCIview_Ship.ShipDateTime}, "yyyy/MM")


I tried and thought "yyyy/MM/ww" would translate to a weekly text string but the "ww" portion doesn't function like the year and month.
 
Well, I've found something that will have to do for now;


IF Maximum({?DateRange}) - Minimum({?DateRange}) < 241
THEN ToText({_PCIview_Ship.ShipDateTime}, "yyyy")+' - Week '+
IF datepart("ww",{_PCIview_Ship.ShipDateTime}) < 10
THEN '0'+ToText(datepart("ww",{_PCIview_Ship.ShipDateTime}),0)
ELSE ToText(datepart("ww",{_PCIview_Ship.ShipDateTime}),0)
ELSE ToText({_PCIview_Ship.ShipDateTime}, "yyyy/MM - MMM")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top