I have a table with the fields representing the number of pills given to a patient at different times of the day.
The calculation below calculates the number of pills given daily x the units with a separate column for the measure of the pill (70mg, 5mg, etc.
If a daily dose is 1 pill in the morning for 70mg/pill, then the total daily dose is 70mg. If 2 pills then 140mg, etc.
The calculation below works as expected.
( "morning" + "afternoon" + "evening" ) * to_number( "units" )
Now I want to add the measure (mg, mcg, tablet) to the calculation result.
Using the sql in the query ( "morning" + "afternoon" + "evening" ) * to_number( "units" )|| "measure" results in a number with many trailing zeros - 250.000000000000000
I need to remove the trailing zeros.
Thank you.
Concatenation
Re: concatenation
Perhaps this will help you: How to format SQL table result.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.