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

Date minus 4 days for some products 1

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
Hello,
I have a formula field in a manual crosstab report that calculates the age of the product when we survey it. This works great for everything except for our post manufactured products (diced and shredded). I need to cleave out the dice and shred products and minus for days from the production date. (WKLY_MozzWM_Dice,WKLY_MozzPS_Dice,WKLY_MozzWM_Shred,WKLY_MozzPS_Shred)

DATE1 = PRODUCTION DATE
DATE3 = SURVEY DATE


FORMULA
If {SAMPLE.SAMPLE_TYPE}in ["WKLY_25#_Gigantino","WKLY_55#_Giganti","WKLY_Boccino","WKLY_Cheddar",
"WKLY_Grat_Romano","WKLY_Mandarini",
"WKLY_Parmesan","WKLY_Parmesan_Grat","WKLY_Parmesan_Shred","WKLY_Provo_DeliStyle","WKLY_Provo_Nello",
"WKLY_Provolettina","WKLY_Salamini"] then
{@in Months}else


(datetimevar d1:={SAMPLE.DATE3};
datetimevar d2:={SAMPLE.DATE1};
totext(Datediff("n",d2,d1)/60 /24,0,"") & " days" )

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Can't really follow this, but you should be able to set one of the date variables (d1) to adjust for the type, as in:

datetimevar d1;
if {SAMPLE.SAMPLE_TYPE}in ["WKLY_25#_Gigantino","WKLY_55#_Giganti","WKLY_Boccino","WKLY_Cheddar",
"WKLY_Grat_Romano","WKLY_Mandarini",
"WKLY_Parmesan","WKLY_Parmesan_Grat","WKLY_Parmesan_Shred","WKLY_Provo_DeliStyle","WKLY_Provo_Nello",
"WKLY_Provolettina","WKLY_Salamini"] then
d1 := {sample.date3}-4 else
d1 := {sample.date3};

-LB
 
How can I incoporate what you're suggesting with the existing formula? The formula I posted works great, I just need to add the IF statement to filter out the shredded products with the -4 days clause.

thanks

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
I'm not sure I used the right products in my suggested 'if' statement, because I can't tell which are the shredded ones, but just replace the products as appropriate and plug it into your formula instead of:

datetimevar d1:={SAMPLE.DATE3};

-LB
 
OK thanks,


-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top