Results 1 to 4 of 4

Thread: How to increase number field by percentage?

  1. #1
    Gene Burch Guest

    How to increase number field by percentage?

    Hello, I need to increase a currency field by 30%
    I have looked all over the place, and I haven't been able to find anything.

    I would post the code I have, but I didn't think it would be relevant. Thanks for any info in advance.

  2. #2
    FRANK KWONG Guest

    How to increase number field by percentage? (reply)

    Use the equation format in magiccell :- <<!field! * 1.03::###.##>>

    FK


    ------------
    Gene Burch at 4/16/01 10:41:39 AM

    Hello, I need to increase a currency field by 30%
    I have looked all over the place, and I haven&#39;t been able to find anything.

    I would post the code I have, but I didn&#39;t think it would be relevant. Thanks for any info in advance.

  3. #3
    Gene Burch Guest

    How to increase number field by percentage? (reply)

    I think that some code would be relevant now.

    Sorry if it is sloppy, I have been playing around with snippet you gave me, and I haven&#39;t been able to get any reaction other than

    &#34;Error in # pairs in - $15.00&#34;

    and this comes when i don&#39;t have a coma after the Format=[Currency], but if I do add a coma, nothing happens. I&#39;ve tried alot of variations, but I don&#39;t understand the proper usage.

    Thanks again for any help, here is the code I have.



    <%
    W=Request(&#34;prodVar&#34
    if (W <> &#34;&#34 then
    Session(&#34;myprodVar&#34 = W
    end if
    LOCALSQL = Session(&#34;myprodVar&#34 + &#34;%&#34;
    %>

    <%
    Response.Buffer=true


    Set MyDb = Server.CreateObject(&#34;AspDB.Pro&#34
    MyDb.dbUnit = 10053
    if (W <> &#34;&#34 then MyDb.dbReset(10053)

    MyDb.dbMDB=Server.MapPath(&#34;/XXX&#34

    MyDb.dbDBType = &#34;Access&#34;
    MyDb.dbMode=&#34;Grid&#34;

    Mydb.dbgridIndex=True

    MyDb.dbGridTableTag=&#34;bordercolorlight=#000000 bordercolordark=#ffffff cellspacing=0 cellpadding=2 border=1 width=100%&#34;

    MYDb.dbOptions=&#34;CellFontTag=Face=Verdana Size=2;HeaderFontTag=Face=Verdana Size=2&#34;

    MyDb.dbColor=&#34;#009EED,#FFFFFF,#009EFD,#FFFFFF, #0080ED&#34;

    MyDb.dbNameMap = &#34;ProdName,Product Name; UnitPrice,Price;&#34;

    MyDb.dbGridDisplayFlds=&#34;1,3&#34;


    MyDb.dbMagicCell = &#34;prodname,,<b>#prodname#</b><br>#proddiz#;unitprice,align=right,format=[currency]<!unitprice! * 1.03::###.##>&#34;


    Mydb.dbGridInc=5

    sq = &#34;Select * FROM ccc WHERE ((CatID Like &#39;&#34;
    sq = sq & LOCALSQL
    sq = sq & &#34;&#39)&#34;
    MyDb.dbSQL = sq

    Mydb.dbNavigation=&#34;Bottom&#34;
    Mydb.dbImageDir=&#34;/images/&#34;

    MyDb.dbNavigationItem=&#34;top,prev,next,bottom,gr idrow,filter,grid&#34;
    Mydb.dbNavigationIcon=&#34;std&#34;
    MyDb.AspDBPro &#39;Display it!
    %>


    ------------
    FRANK KWONG at 4/17/01 12:42:05 AM

    Use the equation format in magiccell :- <<!field! * 1.03::###.##>>

    FK


    ------------
    Gene Burch at 4/16/01 10:41:39 AM

    Hello, I need to increase a currency field by 30%
    I have looked all over the place, and I haven&#39;t been able to find anything.

    I would post the code I have, but I didn&#39;t think it would be relevant. Thanks for any info in advance.

  4. #4
    Frank Kwong Guest

    How to increase number field by percentage? (reply)

    <%
    Set X= Server.CreateObject(&#34;ASP.DB&#34
    X.dbUnit = &#34;999&#34;
    X.dbMode = &#34;Grid&#34;
    X.dbDSN = &#34;DSN=NWIND&#34;
    X.dbMagicCell = &#34;(;,[]#|~/+{})UnitPrice,,<<#UnitPrice# * 1.03 :: Currency>>&#34;
    X.dbSQL = &#34;SELECT ProductID,ProductName,UnitPrice FROM Products&#34;
    X.ASPdb
    %>


    FK

    ------------
    Gene Burch at 4/17/01 3:23:09 AM

    I think that some code would be relevant now.

    Sorry if it is sloppy, I have been playing around with snippet you gave me, and I haven&#39;t been able to get any reaction other than

    &#34;Error in # pairs in - $15.00&#34;

    and this comes when i don&#39;t have a coma after the Format=[Currency], but if I do add a coma, nothing happens. I&#39;ve tried alot of variations, but I don&#39;t understand the proper usage.

    Thanks again for any help, here is the code I have.



    <%
    W=Request(&#34;prodVar&#34
    if (W <> &#34;&#34 then
    Session(&#34;myprodVar&#34 = W
    end if
    LOCALSQL = Session(&#34;myprodVar&#34 + &#34;%&#34;
    %>

    <%
    Response.Buffer=true


    Set MyDb = Server.CreateObject(&#34;AspDB.Pro&#34
    MyDb.dbUnit = 10053
    if (W <> &#34;&#34 then MyDb.dbReset(10053)

    MyDb.dbMDB=Server.MapPath(&#34;/XXX&#34

    MyDb.dbDBType = &#34;Access&#34;
    MyDb.dbMode=&#34;Grid&#34;

    Mydb.dbgridIndex=True

    MyDb.dbGridTableTag=&#34;bordercolorlight=#000000 bordercolordark=#ffffff cellspacing=0 cellpadding=2 border=1 width=100%&#34;

    MYDb.dbOptions=&#34;CellFontTag=Face=Verdana Size=2;HeaderFontTag=Face=Verdana Size=2&#34;

    MyDb.dbColor=&#34;#009EED,#FFFFFF,#009EFD,#FFFFFF, #0080ED&#34;

    MyDb.dbNameMap = &#34;ProdName,Product Name; UnitPrice,Price;&#34;

    MyDb.dbGridDisplayFlds=&#34;1,3&#34;


    MyDb.dbMagicCell = &#34;prodname,,<b>#prodname#</b><br>#proddiz#;unitprice,align=right,format=[currency]<!unitprice! * 1.03::###.##>&#34;


    Mydb.dbGridInc=5

    sq = &#34;Select * FROM ccc WHERE ((CatID Like &#39;&#34;
    sq = sq & LOCALSQL
    sq = sq & &#34;&#39)&#34;
    MyDb.dbSQL = sq

    Mydb.dbNavigation=&#34;Bottom&#34;
    Mydb.dbImageDir=&#34;/images/&#34;

    MyDb.dbNavigationItem=&#34;top,prev,next,bottom,gr idrow,filter,grid&#34;
    Mydb.dbNavigationIcon=&#34;std&#34;
    MyDb.AspDBPro &#39;Display it!
    %>


    ------------
    FRANK KWONG at 4/17/01 12:42:05 AM

    Use the equation format in magiccell :- <<!field! * 1.03::###.##>>

    FK


    ------------
    Gene Burch at 4/16/01 10:41:39 AM

    Hello, I need to increase a currency field by 30%
    I have looked all over the place, and I haven&#39;t been able to find anything.

    I would post the code I have, but I didn&#39;t think it would be relevant. Thanks for any info in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •