L
Larry
I'm trying to use an expression to create a field name in a query.
I have an "Employee" file. that has fields "Sun", "Mon", "Tue" ... "Sat"
that contain their normal number of hours scheduled.
I have a function DayName(schdate) that uses the Weekdayname(date) to get
the day of the week, based on a date field, that returns the string "Mon" or
"Tue" etc.
I want to use the resulting DayName as the fieldname to get the normal
#hours. I have a function that returns the string "Mon" or "Tue" correctly
for the date.
the generic expression for the query field would be Expr1: [employee].[Tue]
to get the employees #hours for a Tuesday.
But I can't find a way to substitue the returned Dayname string for the
field [Tue].
My query field is - MasterSched: [employee].dayname(schdate)
I've tried surrounding the dayname(schdate) with every combination of
brackets, quotes, parentheses but I either get errors or just the string.
I've also tried having the DayName function return the entire
"[employee].[Tue]" but that didn't help.
How can I accomplish using an expression as a field name?
Thanks
I have an "Employee" file. that has fields "Sun", "Mon", "Tue" ... "Sat"
that contain their normal number of hours scheduled.
I have a function DayName(schdate) that uses the Weekdayname(date) to get
the day of the week, based on a date field, that returns the string "Mon" or
"Tue" etc.
I want to use the resulting DayName as the fieldname to get the normal
#hours. I have a function that returns the string "Mon" or "Tue" correctly
for the date.
the generic expression for the query field would be Expr1: [employee].[Tue]
to get the employees #hours for a Tuesday.
But I can't find a way to substitue the returned Dayname string for the
field [Tue].
My query field is - MasterSched: [employee].dayname(schdate)
I've tried surrounding the dayname(schdate) with every combination of
brackets, quotes, parentheses but I either get errors or just the string.
I've also tried having the DayName function return the entire
"[employee].[Tue]" but that didn't help.
How can I accomplish using an expression as a field name?
Thanks