DaniBoy
Registered User.
- Local time
- Today, 22:49
- Joined
- Nov 18, 2001
- Messages
- 175
I figure it out, but now my expression is to big. This is what am trying to do, I have three fields, [newcartsizecode] , [cartsizecode] , [datedelivered] and [Expr1]. I need to pull out a value from this fields depending on the case:
Cart size Codes= 0120,0135,0164,0196
Fiscal Year Quaters
FirstQ= 10/01/any to 12/31/any,
SecQ= 01/01/any to 3/31/any,
ThirdQ= 04/01/any to 06/30/any,
Fourthq= 07/01/any to 09/31/any.
Combination rates by Change
from To FirstQRate SecQRate ThirdQrate ForthQRate
0120 0135 1.00 0.96 0.91 0.87
0120 0164 1.00 0.91 0.82 0.73
0120 0196 1.00 0.92 0.85 0.72
0135 0164 1.00 0.95 0.89 0.84
0135 0196 1.00 0.91 0.82 0.73
0164 0196 1.00 0.95 0.91 0.86
I did it like this but I cant fit all into the query expression.
IIf([newcartsizecode]="0120" And [cartsizecode]="0135" And [datedelivered] Between #10/1/2001# And #12/31/2002#,"1.00",
IIf([newcartsizecode]="0120" And [cartsizecode]="0164" And [datedelivered] Between #10/1/2001# And #12/31/2002#,"1.00",
IIf([newcartsizecode]="0120" And [cartsizecode]="0196" And [datedelivered] Between #10/1/2001# And #12/31/2002#,"1.00",Null))))))))))
I just pasted part for you to see it. How else can I do this? I tried pasting it on the sql but kept giving me syntax erros.
Something else, I could not make the dates have a wildcard!!
Thanks
DaniBoy
Cart size Codes= 0120,0135,0164,0196
Fiscal Year Quaters
FirstQ= 10/01/any to 12/31/any,
SecQ= 01/01/any to 3/31/any,
ThirdQ= 04/01/any to 06/30/any,
Fourthq= 07/01/any to 09/31/any.
Combination rates by Change
from To FirstQRate SecQRate ThirdQrate ForthQRate
0120 0135 1.00 0.96 0.91 0.87
0120 0164 1.00 0.91 0.82 0.73
0120 0196 1.00 0.92 0.85 0.72
0135 0164 1.00 0.95 0.89 0.84
0135 0196 1.00 0.91 0.82 0.73
0164 0196 1.00 0.95 0.91 0.86
I did it like this but I cant fit all into the query expression.
IIf([newcartsizecode]="0120" And [cartsizecode]="0135" And [datedelivered] Between #10/1/2001# And #12/31/2002#,"1.00",
IIf([newcartsizecode]="0120" And [cartsizecode]="0164" And [datedelivered] Between #10/1/2001# And #12/31/2002#,"1.00",
IIf([newcartsizecode]="0120" And [cartsizecode]="0196" And [datedelivered] Between #10/1/2001# And #12/31/2002#,"1.00",Null))))))))))
I just pasted part for you to see it. How else can I do this? I tried pasting it on the sql but kept giving me syntax erros.
Something else, I could not make the dates have a wildcard!!
Thanks
DaniBoy
Last edited: