J
jcookmo
Guest
I am trying to develop a dynamic query which selects a particular field from a table and then sums that column by groups that I'll designate in the code. In this particular situation I have seven fields in a table(plus others)which hold order quantities. Each of these columns represents a day of the week. COUNT_1 is Monday, etc. I only need to sum on the field which corresponds to a particular day of the week. I can't alter the table as it's not in my area to work in.
Can an Array function be used in conjunction with a Weekday function to define a field name in a query?
An User selected ActiveX calendar.value would be used to drive the weekday function.
COUNTFIELD = Array(COUNT_1, COUNT_2, COUNT_3, COUNT_4, COUNT_5, COUNT_6, COUNT_7)
QUERYFIELD = COUNTFIELD(Weekday(Forms.USERCALENDAR.VALUE))
If this can be used, where does the QUERYFIELD variant go in the code, which I believe I would execute on a command button event procedure. I'm a relative novice, hoping that my hunch is correct.
Can an Array function be used in conjunction with a Weekday function to define a field name in a query?
An User selected ActiveX calendar.value would be used to drive the weekday function.
COUNTFIELD = Array(COUNT_1, COUNT_2, COUNT_3, COUNT_4, COUNT_5, COUNT_6, COUNT_7)
QUERYFIELD = COUNTFIELD(Weekday(Forms.USERCALENDAR.VALUE))
If this can be used, where does the QUERYFIELD variant go in the code, which I believe I would execute on a command button event procedure. I'm a relative novice, hoping that my hunch is correct.