If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
IIf statement
Hi, I'm pretty new to this and am trying to make a multiple IIF
statment work. I'm trying to create a date based on current date and a constent month and day. I want to create expiration date that is bi annual ODD on 3-31 of the next odd year. This is what I have ..what am I doing wrong. AptExpDate: IIf(Year(Date()) Mod 2=0 ,"03-31-" & Year(Date()) +1,IIf((Year(Date()) Mod 2=0) and ((Month(Date()) 4), "03-31-" & Year(Date()),"03-31-" & Year(Date())+2 Please help I'm stuck I keep getting errors about not the correct number of arguments or not the correct opening or closing ( or[ Thanks, Tim |
#3
|
|||
|
|||
IIf statement
|
#4
|
|||
|
|||
IIf statement
On Feb 18, 11:20 am, "raskew via AccessMonster.com" u28575@uwe
wrote: Hi Tim: 'From the debug (immediate) window ? dateserial(year(date()) + switch(year(date()) mod 2 = 0, 1, month(date())4, 0, true, 2), 3, 31) 3/31/07 'Explanation: The Switch() function is generally less messy than nested Iif's. 'year(date()) mod 2 = 0 indicates it's currently an even numbered year, so + 1 'month(date())4 indicates (based on first statement) that's an odd numbered year, so if current date less than 1 April add 0 else add 2 HTH - Bob wrote: Hi, I'm pretty new to this and am trying to make a multiple IIF statment work. I'm trying to create a date based on current date and a constent month and day. I want to create expiration date that is bi annual ODD on 3-31 of the next odd year. This is what I have ..what am I doing wrong. AptExpDate: IIf(Year(Date()) Mod 2=0 ,"03-31-" & Year(Date()) +1,IIf((Year(Date()) Mod 2=0) and ((Month(Date()) 4), "03-31-" & Year(Date()),"03-31-" & Year(Date())+2 Please help I'm stuck I keep getting errors about not the correct number of arguments or not the correct opening or closing ( or[ Thanks, Tim -- Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200702/1 THANK YOU BOTH, Thats exactly what I needed. |
Thread Tools | |
Display Modes | |
|
|