UniqueTII
What?
- Local time
- Today, 07:29
- Joined
- Apr 4, 2002
- Messages
- 96
I am trying to make a field in a query that is based on another field. In my reports, I just used an IIF statement to get the output I desired, but now I want to put it right into the query so that I can merge with Word a whole lot easier. The field I want to add is [Term], and it's based on the field [Start Date]. If the start date is between May 16th and August 15th, the term is summer...otherwise, it's academic year. It works find in my reports, but when I put it in the query, I get an error message telling me that there is an extra ")". The statement is as follows:
Term : IIf(((DatePart("m",[Start Date])=5) And (DatePart("d",[Start Date])>15)) Or ((DatePart("m",[Start Date])=8) And (DatePart("d",[Start Date])<16)) Or ((DatePart("m",[Start Date])>5) And (DatePart("m",[Start Date])<8)),"summer","academic year")
Is there anything wrong with that?
Term : IIf(((DatePart("m",[Start Date])=5) And (DatePart("d",[Start Date])>15)) Or ((DatePart("m",[Start Date])=8) And (DatePart("d",[Start Date])<16)) Or ((DatePart("m",[Start Date])>5) And (DatePart("m",[Start Date])<8)),"summer","academic year")
Is there anything wrong with that?