therayster
MIS
I'm trying to generate a field in a query that will group records by when, in the course of a week, they were made. This is the formula I've come up with:
[tt]
group:iif(Weekday([PRINT_DT_TM])<4,"A",
iif(OR(
and(Weekday([PRINT_DT_TM])=4,timevalue([print_dt_tm])>#3:30:00 PM#),
and(Weekday([PRINT_DT_TM])=5,timevalue([print_dt_tm])>#6:00:00 AM#)
)
,"A","B")
[/tt]
But Access gives me an error, "The expression you entered contains invalid syntax. You may have entered a comma without a preceding value or identifier...", with the first word after the opening parentheses of the second IIF function highlighted. I've rearranged the function, but continue to get the error. What am I missing?
[tt]
group:iif(Weekday([PRINT_DT_TM])<4,"A",
iif(OR(
and(Weekday([PRINT_DT_TM])=4,timevalue([print_dt_tm])>#3:30:00 PM#),
and(Weekday([PRINT_DT_TM])=5,timevalue([print_dt_tm])>#6:00:00 AM#)
)
,"A","B")
[/tt]
But Access gives me an error, "The expression you entered contains invalid syntax. You may have entered a comma without a preceding value or identifier...", with the first word after the opening parentheses of the second IIF function highlighted. I've rearranged the function, but continue to get the error. What am I missing?