Re: Working out Square Footage with Feet and Inches
Nicolas Verhaeghe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] RedRed!com IT Department [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jay Blanchard wrote: [snip] I read this as a SQL syntax question, not a math word problem. As in SELECT ..., (some expression equaling sq ft) AS sqft... [/snip] Cool, then do it! It would all depend on how he has his feet and inches saved in the table, and of course, the field names. If we can get that info then maybe we would be better able to post a solution. Sorry Guys, I am just storing the X and Y, so 6 foot 11 inches would be stored as 6.11 I hope the data type is a varchar or something like that. So if I am right the decimal (actually it's pseudo-duodecimal) part is stored as 00 to 11? I would use string functions to separate the pseudo-duodecimal parts, devide it by 12 to make it a decimal, add to the feet parts, then use these values to get a square footage in decimals. Table dimensions: ID X Y 1 6.11 5.04 2 6.02 6.00 select ID, cast((right(x, 2) / 12 + left(x,length(x)-3)) as decimal) as decimalX, cast((right(y, 2) / 12 + left(y,length(y)-3)) as decimal) as decimalY, cast((right(x, 2) / 12 + left(x,length(x)-3)) as decimal) * cast((right(y, 2) / 12 + left(y,length(y)-3)) as decimal) as decimalSQFT from dimensions Gives: ID decimalX decimalY decimalSQFT 1 6.92 5.33 36.8836 2 6.17 6 37.02 Now if you want to convert the decimal part into square inches, you're on your own! Thanks for your reply, I have stored the dimensions as decimal(4,2), does this make a difference? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Working out Square Footage with Feet and Inches
Shaun wrote: I have stored the dimensions as decimal(4,2), does this make a difference? not a very good way to do it if you ask me but here is how to do the calculation. SELECT ((FLOOR(X) + ((X - FLOOR(X))/0.12)) * (FLOOR(Y) + ((Y - FLOOR(Y))/0.12))) as SqFt. FLOOR(X) gives you 6 from the 6.11 X - FLOOR(X) gives you the .11 part .11/.12 gives you the appropriate fraction of a foot.to add back to X then the same thing for Y and multiply. -- Chris W KE5GIX Gift Giving Made Easy Get the gifts you want give the gifts they want One stop wish list for any gift, from anywhere, for any occasion! http://thewishzone.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Working out Square Footage with Feet and Inches
[snip] I have measurements of rooms stored in a table for each house in feet and inches, does anyone know how can I work out the square footage? [/snip] Convert to inches, multiply length * width, divide by 144 (one square foot) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Working out Square Footage with Feet and Inches
There is a technique called unit cancellation that may serve you well. The technique is essentially to treat each unit as an orthogonal vector (orthogonal to all other units), so one unit can't be mixed with any other unit. The only way to convert is to multiply by various forms of 1. 1 is a fraction like (2.54 cm)/(inch) or (1 inch)/(2.54 cm), where the same thing is in the numerator and denominator. You can cancel (i.e. cross out) the same units appearing in the numerator and denominator. The rules free you from having to remember conversion factors. You can just multiply by various forms of 1. For example, if one has 1000 square inches and wishes to know how many square feet: (1000 inch * inch) (1 foot / 12 inch) (1 foot / 12 inch) = 6.944 foot * foot. Notice that the inch x 2 in the numerator cancel with those in the denominator. Because you have to cancel units (by crossing them out on paper), it would be impossible to use 12 alone as the converstion factor, as the units would come out to (foot * inch) rather than (foot * foot) if you did this. It is a system that helps to keep your head straight and prevent human mistakes. I hope there is a web page somewhere that describes this with illustrations. It is hard to do in a text e-mail. You can go surprisingly far with this technique if you forget conversion factors and need to get them again. For example, suppose I've forgotten how many kilometers per mile, but I do remember that there are 2.54 cm/inch ... (1 mile)(5,280 foot/mile)(12 in/1 foot)(2.54cm/1 inch)(1m/100cm)(km/1000m) = 1.6093 km. Dave. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 10:46 AM To: Shaun; mysql@lists.mysql.com Subject: RE: Working out Square Footage with Feet and Inches [snip] I have measurements of rooms stored in a table for each house in feet and inches, does anyone know how can I work out the square footage? [/snip] Convert to inches, multiply length * width, divide by 144 (one square foot) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Working out Square Footage with Feet and Inches
I read this as a SQL syntax question, not a math word problem. As in SELECT ..., (some expression equaling sq ft) AS sqft... -Original Message- From: David T. Ashley [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 11:15 AM To: Jay Blanchard; Shaun; mysql@lists.mysql.com Subject: RE: Working out Square Footage with Feet and Inches There is a technique called unit cancellation that may serve you well. The technique is essentially to treat each unit as an orthogonal vector (orthogonal to all other units), so one unit can't be mixed with any other unit. The only way to convert is to multiply by various forms of 1. 1 is a fraction like (2.54 cm)/(inch) or (1 inch)/(2.54 cm), where the same thing is in the numerator and denominator. You can cancel (i.e. cross out) the same units appearing in the numerator and denominator. The rules free you from having to remember conversion factors. You can just multiply by various forms of 1. For example, if one has 1000 square inches and wishes to know how many square feet: (1000 inch * inch) (1 foot / 12 inch) (1 foot / 12 inch) = 6.944 foot * foot. Notice that the inch x 2 in the numerator cancel with those in the denominator. Because you have to cancel units (by crossing them out on paper), it would be impossible to use 12 alone as the converstion factor, as the units would come out to (foot * inch) rather than (foot * foot) if you did this. It is a system that helps to keep your head straight and prevent human mistakes. I hope there is a web page somewhere that describes this with illustrations. It is hard to do in a text e-mail. You can go surprisingly far with this technique if you forget conversion factors and need to get them again. For example, suppose I've forgotten how many kilometers per mile, but I do remember that there are 2.54 cm/inch ... (1 mile)(5,280 foot/mile)(12 in/1 foot)(2.54cm/1 inch)(1m/100cm)(km/1000m) = 1.6093 km. Dave. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 10:46 AM To: Shaun; mysql@lists.mysql.com Subject: RE: Working out Square Footage with Feet and Inches [snip] I have measurements of rooms stored in a table for each house in feet and inches, does anyone know how can I work out the square footage? [/snip] Convert to inches, multiply length * width, divide by 144 (one square foot) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Working out Square Footage with Feet and Inches
[snip] I read this as a SQL syntax question, not a math word problem. As in SELECT ..., (some expression equaling sq ft) AS sqft... [/snip] Cool, then do it! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Working out Square Footage with Feet and Inches
Jay Blanchard wrote: [snip] I read this as a SQL syntax question, not a math word problem. As in SELECT ..., (some expression equaling sq ft) AS sqft... [/snip] Cool, then do it! It would all depend on how he has his feet and inches saved in the table, and of course, the field names. If we can get that info then maybe we would be better able to post a solution. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Working out Square Footage with Feet and Inches
RedRed!com IT Department [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jay Blanchard wrote: [snip] I read this as a SQL syntax question, not a math word problem. As in SELECT ..., (some expression equaling sq ft) AS sqft... [/snip] Cool, then do it! It would all depend on how he has his feet and inches saved in the table, and of course, the field names. If we can get that info then maybe we would be better able to post a solution. Sorry Guys, I am just storing the X and Y, so 6 foot 11 inches would be stored as 6.11 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Working out Square Footage with Feet and Inches
RedRed!com IT Department [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jay Blanchard wrote: [snip] I read this as a SQL syntax question, not a math word problem. As in SELECT ..., (some expression equaling sq ft) AS sqft... [/snip] Cool, then do it! It would all depend on how he has his feet and inches saved in the table, and of course, the field names. If we can get that info then maybe we would be better able to post a solution. Sorry Guys, I am just storing the X and Y, so 6 foot 11 inches would be stored as 6.11 I hope the data type is a varchar or something like that. So if I am right the decimal (actually it's pseudo-duodecimal) part is stored as 00 to 11? I would use string functions to separate the pseudo-duodecimal parts, devide it by 12 to make it a decimal, add to the feet parts, then use these values to get a square footage in decimals. Table dimensions: ID X Y 1 6.115.04 2 6.026.00 select ID, cast((right(x, 2) / 12 + left(x,length(x)-3)) as decimal) as decimalX, cast((right(y, 2) / 12 + left(y,length(y)-3)) as decimal) as decimalY, cast((right(x, 2) / 12 + left(x,length(x)-3)) as decimal) * cast((right(y, 2) / 12 + left(y,length(y)-3)) as decimal) as decimalSQFT from dimensions Gives: ID decimalXdecimalYdecimalSQFT 1 6.925.3336.8836 2 6.176 37.02 Now if you want to convert the decimal part into square inches, you're on your own! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]