I am looking for a query that will convert inches into feet:
Here is what I have:
SELECT Orderid, Bundlename, PanelID, Linenumber, Height, Length,
Panelstatus, CompletedDT FROM panel
WHERE completedDT BETWEEN '2004-08-25 06:00' AND '2004-08-25 17:00'
and panelstatus='C'
order by completeddt
The height and Lenght are returned as:
Height Length
93.0 25.375
I want those values returned as feet. I'm seeing that I need to apply *12 to
a delcare statment, but not sure how to format the query.
I do not need to display the inches, just round the total footage up.
any help is appreciated.
"Steve T." <stornari@.nvrinc.com> wrote in message
news:OhQVqwuiEHA.3896@.TK2MSFTNGP15.phx.gbl...
> I am looking for a query that will convert inches into feet:
> Here is what I have:
> SELECT Orderid, Bundlename, PanelID, Linenumber, Height, Length,
> Panelstatus, CompletedDT FROM panel
> WHERE completedDT BETWEEN '2004-08-25 06:00' AND '2004-08-25 17:00'
> and panelstatus='C'
> order by completeddt
> The height and Lenght are returned as:
> Height Length
> 93.0 25.375
> I want those values returned as feet. I'm seeing that I need to apply *12
to
> a delcare statment, but not sure how to format the query.
> I do not need to display the inches, just round the total footage up.
> any help is appreciated.
>
|||Oops, hit send too quickly last time...
This will round up the calculation if the precision of the number of feet is
greater than 0.0009; else, it will round down... If you want to make it
round up more often, just change the 0.499:
SELECT Orderid, Bundlename, PanelID, Linenumber,
ROUND((Height/12.0) + 0.499, 0) AS Height,
ROUND((Length/12.0) + 0.499, 0) AS Length,
Panelstatus, CompletedDT FROM panel
WHERE completedDT BETWEEN '2004-08-25 06:00' AND '2004-08-25 17:00'
and panelstatus='C'
order by completeddt
"Steve T." <stornari@.nvrinc.com> wrote in message
news:OhQVqwuiEHA.3896@.TK2MSFTNGP15.phx.gbl...
> I am looking for a query that will convert inches into feet:
> Here is what I have:
> SELECT Orderid, Bundlename, PanelID, Linenumber, Height, Length,
> Panelstatus, CompletedDT FROM panel
> WHERE completedDT BETWEEN '2004-08-25 06:00' AND '2004-08-25 17:00'
> and panelstatus='C'
> order by completeddt
> The height and Lenght are returned as:
> Height Length
> 93.0 25.375
> I want those values returned as feet. I'm seeing that I need to apply *12
to
> a delcare statment, but not sure how to format the query.
> I do not need to display the inches, just round the total footage up.
> any help is appreciated.
>
|||Adam,
Thank you very much.
This will be very helpful.
Thanks again,
Steve
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:OoFiE2uiEHA.3476@.tk2msftngp13.phx.gbl...
> Oops, hit send too quickly last time...
> This will round up the calculation if the precision of the number of feet
is[vbcol=seagreen]
> greater than 0.0009; else, it will round down... If you want to make it
> round up more often, just change the 0.499:
>
> SELECT Orderid, Bundlename, PanelID, Linenumber,
> ROUND((Height/12.0) + 0.499, 0) AS Height,
> ROUND((Length/12.0) + 0.499, 0) AS Length,
> Panelstatus, CompletedDT FROM panel
> WHERE completedDT BETWEEN '2004-08-25 06:00' AND '2004-08-25 17:00'
> and panelstatus='C'
> order by completeddt
> "Steve T." <stornari@.nvrinc.com> wrote in message
> news:OhQVqwuiEHA.3896@.TK2MSFTNGP15.phx.gbl...
*12
> to
>
Wednesday, March 21, 2012
Measurement conversion
Labels:
bundlename,
conversion,
convert,
database,
feethere,
haveselect,
height,
inches,
linenumber,
measurement,
microsoft,
mysql,
oracle,
orderid,
panelid,
query,
server,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment