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

    clinicoffice_user
    Participant

    Hi,
     
    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.
     
    Regards,
     
    Godfrey
    Director
    The Running School Woking

    #33267

    Support
    Keymaster

    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.