PC Review


Reply
Thread Tools Rate Thread

Decimal postion issue

 
 
Mitch_A
Guest
Posts: n/a
 
      4th Feb 2006
I setup a website for my softball team to use which includes a database that
keeps statistics.

Ive got everything working just fine but my queries for batting average show
the decimal positions incorrectly. I want them to show up as .389 not
..38943343243. Ive researched SQL for weeks now and I can find the
NUMERIC(4,3) statement but I cant seem to get it into the working query.
Would the ROUND function work?

Here is the query

SELECT sum(Hits)/(sum(ABs)-sum(Walks))
FROM Results

Can someone PLEASE show me where it goes?

TIA

Mitch


 
Reply With Quote
 
 
 
 
Stefan B Rusynko
Guest
Posts: n/a
 
      4th Feb 2006
Try

SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results

Then display is as
<% =Round(BatAvg,3) %>

Or better still use
SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as AtWalks FROM Results

<% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPa...3/Default.aspx
_____________________________________________


"Mitch_A" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
|I setup a website for my softball team to use which includes a database that
| keeps statistics.
|
| Ive got everything working just fine but my queries for batting average show
| the decimal positions incorrectly. I want them to show up as .389 not
| .38943343243. Ive researched SQL for weeks now and I can find the
| NUMERIC(4,3) statement but I cant seem to get it into the working query.
| Would the ROUND function work?
|
| Here is the query
|
| SELECT sum(Hits)/(sum(ABs)-sum(Walks))
| FROM Results
|
| Can someone PLEASE show me where it goes?
|
| TIA
|
| Mitch
|
|


 
Reply With Quote
 
Mitch_A
Guest
Posts: n/a
 
      6th Feb 2006
Thank You very much Sir! I'll give it a go this evening.

Mitch


"Stefan B Rusynko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try
>
> SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>
> Then display is as
> <% =Round(BatAvg,3) %>
>
> Or better still use
> SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as AtWalks
> FROM Results
>
> <% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> To find the best Newsgroup for FrontPage support see:
> http://www.frontpagemvps.com/FrontPa...3/Default.aspx
> _____________________________________________
>
>
> "Mitch_A" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> |I setup a website for my softball team to use which includes a database
> that
> | keeps statistics.
> |
> | Ive got everything working just fine but my queries for batting average
> show
> | the decimal positions incorrectly. I want them to show up as .389 not
> | .38943343243. Ive researched SQL for weeks now and I can find the
> | NUMERIC(4,3) statement but I cant seem to get it into the working query.
> | Would the ROUND function work?
> |
> | Here is the query
> |
> | SELECT sum(Hits)/(sum(ABs)-sum(Walks))
> | FROM Results
> |
> | Can someone PLEASE show me where it goes?
> |
> | TIA
> |
> | Mitch
> |
> |
>
>



 
Reply With Quote
 
Mitch_A
Guest
Posts: n/a
 
      6th Feb 2006
Inserted Snips:

"Stefan B Rusynko" <(E-Mail Removed)> wrote in

This part worked in the query and the results show but still with an
incorrect decimal position.

> SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>



This part Im not really sure where I should put it? Can you explain in a
bit more detail? I did try to replace the <<Express101>> in the DB results
but it didnt work. Should I use the "Use HTML" option?

> Then display is as
> <% =Round(BatAvg,3) %>
>


I tried this but the query failed no matter how I entered it.

> Or better still use
> SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as AtWalks
> FROM Results
>


As before Im not real sure where this goes even had the query worked.

> <% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>



Thanks you very much for any help past and future!

Mitch


 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      7th Feb 2006
My code samples were for hand coded ASP, not for use w/ the DB results wizard

If you have used the query
SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results

Find in the displayed DBRW the field by FP DBRW using : BatAvg
- probably as something like: =FP_FieldVal(fp_rs,"BatAvg")
and wrap it in the Round Function as
=Round(FP_FieldVal(fp_rs,"BatAvg"),3)
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPa...3/Default.aspx
_____________________________________________


"Mitch_A" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
| Inserted Snips:
|
| "Stefan B Rusynko" <(E-Mail Removed)> wrote in
|
| This part worked in the query and the results show but still with an
| incorrect decimal position.
|
| > SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
| >
|
|
| This part Im not really sure where I should put it? Can you explain in a
| bit more detail? I did try to replace the <<Express101>> in the DB results
| but it didnt work. Should I use the "Use HTML" option?
|
| > Then display is as
| > <% =Round(BatAvg,3) %>
| >
|
| I tried this but the query failed no matter how I entered it.
|
| > Or better still use
| > SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as AtWalks
| > FROM Results
| >
|
| As before Im not real sure where this goes even had the query worked.
|
| > <% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>
|
|
| Thanks you very much for any help past and future!
|
| Mitch
|
|


 
Reply With Quote
 
Mitch_A
Guest
Posts: n/a
 
      7th Feb 2006
I think Im getting really close thanks.

I found the entry in the DBRW <%=FP_FieldVal(fp_rs,"BatAvg")%

I can easily change it but when I save the page a dialog box pops up telling
me "The contents of a FrontPage component have been modified. These
contents will be overwritten when you save this page". I click OK and my
changes are reverted back as before. Any ideas? Ive checked the
attributes and its not read only.

Thanks again.

Mitch
"Stefan B Rusynko" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> My code samples were for hand coded ASP, not for use w/ the DB results
> wizard
>
> If you have used the query
> SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>
> Find in the displayed DBRW the field by FP DBRW using : BatAvg
> - probably as something like: =FP_FieldVal(fp_rs,"BatAvg")
> and wrap it in the Round Function as
> =Round(FP_FieldVal(fp_rs,"BatAvg"),3)
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> To find the best Newsgroup for FrontPage support see:
> http://www.frontpagemvps.com/FrontPa...3/Default.aspx
> _____________________________________________
>
>
> "Mitch_A" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> | Inserted Snips:
> |
> | "Stefan B Rusynko" <(E-Mail Removed)> wrote in
> |
> | This part worked in the query and the results show but still with an
> | incorrect decimal position.
> |
> | > SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
> | >
> |
> |
> | This part Im not really sure where I should put it? Can you explain in
> a
> | bit more detail? I did try to replace the <<Express101>> in the DB
> results
> | but it didnt work. Should I use the "Use HTML" option?
> |
> | > Then display is as
> | > <% =Round(BatAvg,3) %>
> | >
> |
> | I tried this but the query failed no matter how I entered it.
> |
> | > Or better still use
> | > SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as
> AtWalks
> | > FROM Results
> | >
> |
> | As before Im not real sure where this goes even had the query worked.
> |
> | > <% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>
> |
> |
> | Thanks you very much for any help past and future!
> |
> | Mitch
> |
> |
>
>



 
Reply With Quote
 
Kathleen Anderson [MVP - FrontPage]
Guest
Posts: n/a
 
      7th Feb 2006
Can you make the change in the gray-colored code? If so, do that, and save
the change while you're still in Code View.

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/
FrontPage Support: http://www.frontpagemvps.com/




"Mitch_A" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I think Im getting really close thanks.
>
> I found the entry in the DBRW <%=FP_FieldVal(fp_rs,"BatAvg")%
>
> I can easily change it but when I save the page a dialog box pops up
> telling me "The contents of a FrontPage component have been modified.
> These contents will be overwritten when you save this page". I click OK
> and my changes are reverted back as before. Any ideas? Ive checked the
> attributes and its not read only.
>
> Thanks again.
>
> Mitch
> "Stefan B Rusynko" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> My code samples were for hand coded ASP, not for use w/ the DB results
>> wizard
>>
>> If you have used the query
>> SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>>
>> Find in the displayed DBRW the field by FP DBRW using : BatAvg
>> - probably as something like: =FP_FieldVal(fp_rs,"BatAvg")
>> and wrap it in the Round Function as
>> =Round(FP_FieldVal(fp_rs,"BatAvg"),3)
>> --
>>
>> _____________________________________________
>> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
>> "Warning - Using the F1 Key will not break anything!" (-;
>> To find the best Newsgroup for FrontPage support see:
>> http://www.frontpagemvps.com/FrontPa...3/Default.aspx
>> _____________________________________________
>>
>>
>> "Mitch_A" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> | Inserted Snips:
>> |
>> | "Stefan B Rusynko" <(E-Mail Removed)> wrote in
>> |
>> | This part worked in the query and the results show but still with an
>> | incorrect decimal position.
>> |
>> | > SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>> | >
>> |
>> |
>> | This part Im not really sure where I should put it? Can you explain in
>> a
>> | bit more detail? I did try to replace the <<Express101>> in the DB
>> results
>> | but it didnt work. Should I use the "Use HTML" option?
>> |
>> | > Then display is as
>> | > <% =Round(BatAvg,3) %>
>> | >
>> |
>> | I tried this but the query failed no matter how I entered it.
>> |
>> | > Or better still use
>> | > SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as
>> AtWalks
>> | > FROM Results
>> | >
>> |
>> | As before Im not real sure where this goes even had the query worked.
>> |
>> | > <% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>
>> |
>> |
>> | Thanks you very much for any help past and future!
>> |
>> | Mitch
>> |
>> |
>>
>>

>
>



 
Reply With Quote
 
Mitch_A
Guest
Posts: n/a
 
      8th Feb 2006
This is the section from the HTML view.
%=FP_FieldVal(fp_rs,"BatAvg")% and its Maroon. I change it to
%=Round(FP_FieldVal(fp_rs,"BatAvg"),3)
It just will not accept this change and reverts back.

Mitch


"Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Can you make the change in the gray-colored code? If so, do that, and save
> the change while you're still in Code View.
>
> --
>
> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> web: http://www.spiderwebwoman.com/resources/
> FrontPage Support: http://www.frontpagemvps.com/
>
>
>
>
> "Mitch_A" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I think Im getting really close thanks.
>>
>> I found the entry in the DBRW <%=FP_FieldVal(fp_rs,"BatAvg")%
>>
>> I can easily change it but when I save the page a dialog box pops up
>> telling me "The contents of a FrontPage component have been modified.
>> These contents will be overwritten when you save this page". I click OK
>> and my changes are reverted back as before. Any ideas? Ive checked the
>> attributes and its not read only.
>>
>> Thanks again.
>>
>> Mitch
>> "Stefan B Rusynko" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> My code samples were for hand coded ASP, not for use w/ the DB results
>>> wizard
>>>
>>> If you have used the query
>>> SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>>>
>>> Find in the displayed DBRW the field by FP DBRW using : BatAvg
>>> - probably as something like: =FP_FieldVal(fp_rs,"BatAvg")
>>> and wrap it in the Round Function as
>>> =Round(FP_FieldVal(fp_rs,"BatAvg"),3)
>>> --
>>>
>>> _____________________________________________
>>> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
>>> "Warning - Using the F1 Key will not break anything!" (-;
>>> To find the best Newsgroup for FrontPage support see:
>>> http://www.frontpagemvps.com/FrontPa...3/Default.aspx
>>> _____________________________________________
>>>
>>>
>>> "Mitch_A" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>> | Inserted Snips:
>>> |
>>> | "Stefan B Rusynko" <(E-Mail Removed)> wrote in
>>> |
>>> | This part worked in the query and the results show but still with an
>>> | incorrect decimal position.
>>> |
>>> | > SELECT sum(Hits)/(sum(ABs)-sum(Walks)) AS BatAvg FROM Results
>>> | >
>>> |
>>> |
>>> | This part Im not really sure where I should put it? Can you explain
>>> in a
>>> | bit more detail? I did try to replace the <<Express101>> in the DB
>>> results
>>> | but it didnt work. Should I use the "Use HTML" option?
>>> |
>>> | > Then display is as
>>> | > <% =Round(BatAvg,3) %>
>>> | >
>>> |
>>> | I tried this but the query failed no matter how I entered it.
>>> |
>>> | > Or better still use
>>> | > SELECT sum(Hits) AS AllHits, (sum(ABs) AS AtBats ,sum(Walks) as
>>> AtWalks
>>> | > FROM Results
>>> | >
>>> |
>>> | As before Im not real sure where this goes even had the query worked.
>>> |
>>> | > <% BatAvg=Round(AllHits/(AtBats-AtWal),3) %>
>>> |
>>> |
>>> | Thanks you very much for any help past and future!
>>> |
>>> | Mitch
>>> |
>>> |
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
decimal issue jtfalk Microsoft Access VBA Modules 1 26th Apr 2010 12:32 AM
issue with decimal points Associates Microsoft Access 4 21st Mar 2008 12:24 AM
Format issue ... 2 decimal places displayed? BobC Microsoft Access Forms 19 22nd Feb 2008 09:13 AM
Decimal point/comma issue =?Utf-8?B?RXhjZWxlcmF0ZS1ubA==?= Microsoft Excel Misc 3 12th Jan 2006 09:47 PM
Decimal place and rounding off issue Naomi Microsoft Excel Worksheet Functions 2 20th Jul 2003 12:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:30 PM.