Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #31426

    I have CO v 5 with Synergy Physio and Rehab Ltd in Surrey.
    Could you tell me what the SQL code is to display a column of data in a report in Currency format – i.e. £x,xxx.xx?  This would be for a custom column I have created from two other numeric data fields such as salecost or purchasecost.  I have tried cast as numeric but that does not give the correct result.
    The Running School Woking


    That’s a good question!

    As far as the physical field type in the database, NUMERIC is the correct one which we use for currency values in ClinicOffice. However, there are many other “decimal” values in the database which are also defined as NUMERIC fields – so the question is, how does ClinicOffice know whether a NUMERIC field should be a currency or not?

    The answer lies in the physical field name. Here’s the internal code in ClinicOffice which determines whether a field is considered to be a currency value :-

    bool is_currency =
    (FieldName.Contains("cost") || FieldName.Contains("price") ||
    FieldName.Contains("total") || FieldName.Contains("amount") ||
    FieldName.Contains("amt") || FieldName.Contains("purchase") ||
    FieldName.Contains("tax") || FieldName.Contains("net") ||
    FieldName.Contains("gross") || FieldName.Contains("profit") ||
    FieldName.Contains("balance") || FieldName.Contains("outstanding"));

    As you can see from the above, if the field name contains one of those keywords, then it’s considered to be a currency value and hence formatted accordingly.

    We hope this helps to answer your question. Please let us know if we can help any further.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.