Fat Controller

Space Cowboy

Member
Local time
Today, 08:28
Joined
May 19, 2024
Messages
245
Good afternoon Good people,

I am old and overweight with various age and weight related problems. I am trying to correlate my health with me weight. As my weight goes up I get foggy head and various other problems etc,
MY weight is recorded in pounds, it fluctuates between 235 ad 250. My brain will not recognize that as a meaningful figure.
Is there any way I can convert the column to show stone and pounds, I know I need to divide by 14 but how can I show the "remainder"?

I want it to show two digits for the Lb column.

IE
18-03
17-11

Is this even possible?
 
If you have a weight in pounds, you can perhaps do this:

Code:
DIM strWeight AS STRING
DIM lWeight AS LONG
...
strWeight = CSTR( lWeight \ 14 ) & "-" & FORMAT( ( lWeight MOD 14 ), "##" )
...

The backslash in the first part is a "forced integer divide" that will not return a fraction (unlike forward slash that might TRY to make it fractional).
The MOD in the second part is a remaindering function that gives you the remainder of another forced integer division.
 
thanks @The_Doc_Man
Will that calculation go into SQL anywhere, and if so where? as part of select?
 
Good afternoon Good people,

I am old and overweight with various age and weight related problems. I am trying to correlate my health with me weight. As my weight goes up I get foggy head and various other problems etc,
MY weight is recorded in pounds, it fluctuates between 235 ad 250. My brain will not recognize that as a meaningful figure.
Is there any way I can convert the column to show stone and pounds, I know I need to divide by 14 but how can I show the "remainder"?

I want it to show two digits for the Lb column.

IE
18-03
17-11

Is this even possible?
It will not be an easy road, but you most certainly can control weight, diet and exercise. I managed that process successfully over the last 8 years. It's a journey of months, not weeks, and will never end on this side of the dirt.

Among other things I created an Access application (with a SQL Azure backend) to track numerous aspects of the process, including diet and exercise. I found that the discipline of recording everything I eat and every walk I take helps keep the focus on improving. I know that no one else sees the data, but that doesn't matter. It keeps me accountable to myself.

Good luck in your journey. I'll be rooting for you.

Get Up and Walk It Off
 
It will not be an easy road, but you most certainly can control weight, diet and exercise. I managed that process successfully over the last 8 years. It's a journey of months, not weeks, and will never end on this side of the dirt.

Among other things I created an Access application (with a SQL Azure backend) to track numerous aspects of the process, including diet and exercise. I found that the discipline of recording everything I eat and every walk I take helps keep the focus on improving. I know that no one else sees the data, but that doesn't matter. It keeps me accountable to myself.

Good luck in your journey. I'll be rooting for you.

Get Up and Walk It Off
Thank You for your kind words and support George.
 
thanks @The_Doc_Man
Will that calculation go into SQL anywhere, and if so where? as part of select?


The math operators will work OK but the functions are sometimes trickier than other times.

IF you make a SELECT query, you could do something similar to:

Code:
SELECT Weight As FullPounds, Weight \ 14 As Stone, Weight MOD 14 As  PoundsPart, other-fields
FROM yourtable ;

Then you could use formatting functions on the query to get anything you wanted to see.
 
Note that Gasman is not wrong that you could make a function, but it would return a string function (because of that dash in the middle) so would require extra work if you wanted to later compute anything from it OR use it in a chart.
 

Users who are viewing this thread

Back
Top Bottom