Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a "TableX" which contains (among others) the fields:
- XPeriod which contains values such as '2013-11', '2013-10' etc
- XRecNo this field always contains "1" and I use it for more efficient record counting (better and faster than COUNT())
I also have a Calendar in the application but its not linked to "TableX".
The calendar has all the typical Year, Month, Day components.
When the user makes a Year/Month selection, I have defined a variable called "eSelectedPeriod" which I have defined as:
Year & '-' & num(Month)
... so when the user makes a year/month selection, "eSelectedPeriod" contains the correct value (e.g. 2013-11)
My requirement is simple. I want to return the sum of XRecNo where XPeriod = eSelectionPeriod
= sum({$<[XPeriod] = {'$(eSelectedPeriod)'}>}XRecNo)
does not work - brings up the error:
"Error in set modifier ad hoc element list: '.' or ')' expected
If I create a test variable (say vTestPeriod) that contains a value (say) '2013-11'
then:
= sum({$<[XPeriod] = {'$(vTestPeriod)'}>}XRecNo)
= sum({$<[XPeriod] = {"$(vTestPeriod)"}>}XRecNo)
both work fine
Can someone explain to what I need to do differently in the case where a variable has to be evaluated?
Thanks in advance
Alexis
Try adding an equals sign to your variable:
=Year & '-' & Num(Month)
Can you post your app?
Try adding an equals sign to your variable:
=Year & '-' & Num(Month)
Can you post your app?
I guess, while you are defining your variable in the variable overview window, you are missing '=' sing. Put an '=' before your definition expression of the variable and try.
Well done Jason (and treseco)
Putting an equal sign solved the problem - I knew it would be simple - this was driving me insane.
Both variants of:
= sum({$<[XPeriod] = {'$(eSelectedPeriod)'}>} XRecNo) // without equal sign
= sum({$<[XPeriod] = {'$(=eSelectedPeriod)'}>} XRecNo) // with an equal sign
see to work fine.
Thanks again
Alexis