I have a function, GetNumWeeks, in the Module section, which is very simple:
Function GetNumWeeks() As Integer
GetNumWeeks = 13
End Function
I am TRYING to use this in a Select Query, in one line of code in the WHERE clause:
(Att.DateWeekStarting Between Nz([Enter Start Date], DateAdd("ww",-1,-GetNumWeeks(), Date()))
And Dateadd("ww",[Enter the Period], Nz(GetNumWeeks(), DateAdd("ww",-1,-GetNumWeeks(), Date()))))
Very simply, this is suppose to allow me to enter a Starting date, with a default of one week ago, and automatically set the end date to 13 weeks eariler than the start date. The 13 weeks is a defult from the function. When I try and run the query I get a message that says: Wrong number of arguements used with fuction in query exzpression. I am just getting my feet wet with functions and I don't know them very well. Thanks you to anyone who lends a helping hand on this one.
Function GetNumWeeks() As Integer
GetNumWeeks = 13
End Function
I am TRYING to use this in a Select Query, in one line of code in the WHERE clause:
(Att.DateWeekStarting Between Nz([Enter Start Date], DateAdd("ww",-1,-GetNumWeeks(), Date()))
And Dateadd("ww",[Enter the Period], Nz(GetNumWeeks(), DateAdd("ww",-1,-GetNumWeeks(), Date()))))
Very simply, this is suppose to allow me to enter a Starting date, with a default of one week ago, and automatically set the end date to 13 weeks eariler than the start date. The 13 weeks is a defult from the function. When I try and run the query I get a message that says: Wrong number of arguements used with fuction in query exzpression. I am just getting my feet wet with functions and I don't know them very well. Thanks you to anyone who lends a helping hand on this one.