Formatting calculated query result

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doma23
    New Member
    • May 2010
    • 107

    Formatting calculated query result

    I have a query that looks like this:

    Code:
    x: 
    IIf([qry-2008]![AC]="0";"n/m";
    (
    [qry-2009]![AC]
    /
    [qry-2008]![AC]-1)*100*100 & "bp"
    )
    The first line of code "iif" is used to check if denominator is a zero.
    First - I've put the zero in quotatian marks as without them I get "data type mismatch" error. Why is that?

    Second - the overall result is something like "123.123456 bp".
    What I would like to do is to format this number to ignore all the numbers after decimal point, to this "123bp".
    How can I do that?
    Thank you!
  • doma23
    New Member
    • May 2010
    • 107

    #2
    Unfortunately, there is another problem.
    I'm extracting this data to excel, but because of "n/m" (non measurable) in the code, it puts the numbers as a string and I can't format them at all.
    One of the solutions could be to use "null" instead of "n/m", but i still need to add this "n/m" somehow (automatically) ...?

    Comment

    Working...