merlynsdad
Programmer
In a calculated query field I'm converting time from 5 time zones to CST, and my code (in part) looks like this:
CTHour: IIf([site_name]="buffalo",Hour([CD_ANSWER_TM])-1,
IIf([site_name]="puertorico",Hour([CD_ANSWER_TM])-2,
IIf([site_name]="detroit",Hour([CD_ANSWER_TM])-1,
IIF([site_name])="seattle",Hour([CD_ANSWER_TM])+2))))
That part works, but because Puerto Rico does not go on daylight time, I need to put an AND in if the date is between 3/13/2011 and 11/6/2011 so that during that period of time the THEN part of the "puertorico" line is Hour([CD_ANSWER_TM])-1. I've tried something like
IIF([site_name])="puertorico" and (([date])>#03/13/2011# and <#11/06/2011#),Hour([CD-ANSWER_TM])-1
but got an invalid syntax error. Will Access even take an IIF AND command, and if so what is the syntax? Thanks.
CTHour: IIf([site_name]="buffalo",Hour([CD_ANSWER_TM])-1,
IIf([site_name]="puertorico",Hour([CD_ANSWER_TM])-2,
IIf([site_name]="detroit",Hour([CD_ANSWER_TM])-1,
IIF([site_name])="seattle",Hour([CD_ANSWER_TM])+2))))
That part works, but because Puerto Rico does not go on daylight time, I need to put an AND in if the date is between 3/13/2011 and 11/6/2011 so that during that period of time the THEN part of the "puertorico" line is Hour([CD_ANSWER_TM])-1. I've tried something like
IIF([site_name])="puertorico" and (([date])>#03/13/2011# and <#11/06/2011#),Hour([CD-ANSWER_TM])-1
but got an invalid syntax error. Will Access even take an IIF AND command, and if so what is the syntax? Thanks.