Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a button that toggles a string value that changes to this;
'Week of '&WeekName(GanttDate) but drops the last part after 'Week of'
it wont work in my button. only if a Paste it directly in the variable editor.
Code for Action
=If(vTimeScaleGanttBtn = 1, 'MonthName(GanttDate)', 'Week of'&WeekName(GanttDate) )
Yep, Jason is right.
However I think the & is missing and you need quotes around weekname:
=If(vTimeScaleGanttBtn = 1, 'MonthName(GanttDate)', chr(39) & 'Week of' & chr(39) & '&' & 'WeekName(GanttDate)' )
Could you post a sample qvw that displays your problem?
My guess is that in your formula:
=If(vTimeScaleGanttBtn = 1, 'MonthName(GanttDate)', 'Week of'&WeekName(GanttDate) )
the 'Week of'&WeekName(GanttDate) is not a string, its a string with a function. Are you looking just for the string of it? or are you trying to accomplish something else?
Did you want 'Week of&WeekName(GanttDate)'?
Hope this helps!
Yes that seems close.. I was trying to concat a String to a Function. but in the action button I'm not sure how to code it syntax wise to make it work. I use a $ expansion in my chart where it plugs in.
This is what I get after I click the button. using this: 'Week of&WeekName(GanttDate)'
I think you need to replace the ' with Chr(39) so they resolve to ' when the $-expansion is used:
If(vTimeScaleGanttBtn = 1, 'MonthName(GanttDate)', Chr(39) & 'Week of ' & Chr(39) & WeekName(GanttDate) )
Hope this helps,
Jason
Yep, Jason is right.
However I think the & is missing and you need quotes around weekname:
=If(vTimeScaleGanttBtn = 1, 'MonthName(GanttDate)', chr(39) & 'Week of' & chr(39) & '&' & 'WeekName(GanttDate)' )
Yeah makes sense. Chr() works well.
Almost there. Maybe its missing a Chr(39). Tried adding oen on end then it just blew up.
Chr(39) & 'Week of ' & Chr(39) & WeekName(GanttDate)
Chr(39) & 'Week of ' & Chr(39) & WeekName(GanttDate)& Chr(39)
Did this;
That worked. Just need a to add a space. Wow tricky stuff.
Thanks All!
Jeremy real quick how would I convert this one to work?
Date(GanttDate,'DD') The part that is getting me on this one is the 'DD') part
This should do it:
='Date(GanttDate,' & chr(39) &'DD' & chr(39) & ')'
The trick is adding chr(39) anywhere you want to add the single quotes. It can be confusing sometimes i know haha
Hope this helps!
Awesome that worked.
I guess it takes some getting use to where to place these chr()