In writing a formula in my query...and I keep getting an error...
Projected: IIf(Weekday(Now())-1=0,0,[SALES_PIECES_WTD]/DLookUp("[day_cum_perc]","tbl Day Percent","[Week]=[Week_Number] and Weekday(Now())-1"))
The error I keep getting is with the DLookUp part. I have the Week_Number declared in the query, but when I run the query I get an error "MS Access can't find the name [Week_Number] you entered in the expression" If I hard code the week number it runs the query correctly...
Any ideas how to get around this...
Thanks,
Jan
Projected: IIf(Weekday(Now())-1=0,0,[SALES_PIECES_WTD]/DLookUp("[day_cum_perc]","tbl Day Percent","[Week]=[Week_Number] and Weekday(Now())-1"))
The error I keep getting is with the DLookUp part. I have the Week_Number declared in the query, but when I run the query I get an error "MS Access can't find the name [Week_Number] you entered in the expression" If I hard code the week number it runs the query correctly...
Any ideas how to get around this...
Thanks,
Jan