Ask a Question related to ASP Database, Design and Development.
-
Robin #1
decimal vs. int vs. numeric ???
First, I apologize if this is posted in the wrong area ... it has to do with
mySQL and ASP ...
I had two fields in a mySQL table:
cost
quantity
Both were of the type Int. I needed decimal places for the Cost field so
changed both to be Numeric (also tried this with the type being decimal)
cost - numeric 6,2
quantity - numeric 11,0
Before when they were both Int I had an asp page :
vTot = cost * quantity
This was working fine, but didn't take decimals.
When I changed the data type to decimal/numeric I'm getting a Type Mismatch.
Any idea on why this is happening and how to fix it?
Thanks!!!
Robin Guest
-
decimal validation
how can i use javascript to ensure a the user enters a decimal number up to a certain place holder? what would that code look like? Chris O'Brien -
Double or Decimal?
I need a variable to store values from -0.5 to 5.0 Should I use a decimal or a double for this as it looks like I can user either. Any help on... -
Converting to decimal
I've imported some data from a mainframe db via text file. The file contains this: credit_hours pic 9(2)v9 (COBOL, it basically says 3 number... -
Converting from decimal to hex
Hi. I have an array consisting of mac addresses in decimal form seperated by : Like this: 0:0:33:195:37:6 0:0:180:75:15:17 and so on I now... -
converting HH:MM to a decimal
I have 3 pairs of time in/out (24 our clock) that I need to calculate the decimal equivalent of the total time worked for that day. example: ... -
Aaron Bertrand - MVP #2
Re: decimal vs. int vs. numeric ???
> When I changed the data type to decimal/numeric I'm getting a Type
Mismatch.
Can you show the code that causes this error?
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Aaron Bertrand - MVP Guest
-
Robin #3
Re: decimal vs. int vs. numeric ???
<%vTot = rsList("Quantity") * rsList("Cost")%>
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:OWwreESOEHA.624@TK2MSFTNGP11.phx.gbl...> Mismatch.> > When I changed the data type to decimal/numeric I'm getting a Type
>
> Can you show the code that causes this error?
>
> --
> Aaron Bertrand
> SQL Server MVP
> [url]http://www.aspfaq.com/[/url]
>
>
Robin Guest
-
Aaron Bertrand - MVP #4
Re: decimal vs. int vs. numeric ???
Is it possible that one or both are null?
Try
<%
q = CInt(rsList("Quantity"))
c = CDbl(rsList("Cost"))
vTot = CDbl(q * c)
%>
Quantity should be INT, by the way, not NUMERIC. Unless you can buy half of
something, you will never need the decimal places.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Robin" <rlaxton@energymasterllc.com> wrote in message
news:56Qoc.12282$5z5.757@bignews2.bellsouth.net...> <%vTot = rsList("Quantity") * rsList("Cost")%>
>
>
>
> "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
> news:OWwreESOEHA.624@TK2MSFTNGP11.phx.gbl...>> > Mismatch.> > > When I changed the data type to decimal/numeric I'm getting a Type
> >
> > Can you show the code that causes this error?
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > [url]http://www.aspfaq.com/[/url]
> >
> >
>
Aaron Bertrand - MVP Guest
-
Robin #5
Re: decimal vs. int vs. numeric ???
Genious ... that worked. What exactly is that code doing??
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:OVb5VVSOEHA.1620@TK2MSFTNGP12.phx.gbl...of> Is it possible that one or both are null?
>
> Try
>
> <%
> q = CInt(rsList("Quantity"))
> c = CDbl(rsList("Cost"))
> vTot = CDbl(q * c)
> %>
>
> Quantity should be INT, by the way, not NUMERIC. Unless you can buy half> something, you will never need the decimal places.
>
> --
> Aaron Bertrand
> SQL Server MVP
> [url]http://www.aspfaq.com/[/url]
>
>
>
>
> "Robin" <rlaxton@energymasterllc.com> wrote in message
> news:56Qoc.12282$5z5.757@bignews2.bellsouth.net...>> > <%vTot = rsList("Quantity") * rsList("Cost")%>
> >
> >
> >
> > "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
> > news:OWwreESOEHA.624@TK2MSFTNGP11.phx.gbl...> >> > > > When I changed the data type to decimal/numeric I'm getting a Type
> > > Mismatch.
> > >
> > > Can you show the code that causes this error?
> > >
> > > --
> > > Aaron Bertrand
> > > SQL Server MVP
> > > [url]http://www.aspfaq.com/[/url]
> > >
> > >
> >
>
Robin Guest
-
Aaron Bertrand - MVP #6
Re: decimal vs. int vs. numeric ???
Converting quantity to an Integer, and converting cost to a Double. You can
find these and other conversion methods in the VBScript documentation.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Robin" <rlaxton@energymasterllc.com> wrote in message
news:UyQoc.29301$su1.623@bignews3.bellsouth.net...> Genious ... that worked. What exactly is that code doing??
Aaron Bertrand - MVP Guest
-
Astra #7
Re: decimal vs. int vs. numeric ???
Hi Aaron
Where is this VB script documentation?
I use wordpad/notepad and IIS/PWS to create ASP pages and I've not been able
to source this kind of documentation in a readable format anyway.
Rgds
Robbie
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:O0YGMdSOEHA.3596@tk2msftngp13.phx.gbl...
Converting quantity to an Integer, and converting cost to a Double. You can
find these and other conversion methods in the VBScript documentation.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Robin" <rlaxton@energymasterllc.com> wrote in message
news:UyQoc.29301$su1.623@bignews3.bellsouth.net...> Genious ... that worked. What exactly is that code doing??
Astra Guest
-
Bob Barrows [MVP] #8
Re: decimal vs. int vs. numeric ???
Documentation for every MS product can be found at
msdn.microsoft.com/library where you can read it online. For the vbscript
documentation, expand the Web Development node in the table of contents
(toc). Then the Scripting node, then the Documentation node, then Windows
Script Technology node, and lastly the VBScript node, where you will see
both a User's Guide and the Reference.
Additionally, you can download the Scripting documentation from :
[url]http://tinyurl.com/7rk6[/url]
HTH,
Bob Barrows
Astra wrote:--> Hi Aaron
>
> Where is this VB script documentation?
>
> I use wordpad/notepad and IIS/PWS to create ASP pages and I've not
> been able to source this kind of documentation in a readable format
> anyway.
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Laphan #9
Re: decimal vs. int vs. numeric ???
Many thanks Bob
Bob Barrows [MVP] <reb01501@NOyahoo.SPAMcom> wrote in message
news:uDhiFvaOEHA.2740@TK2MSFTNGP11.phx.gbl...
Documentation for every MS product can be found at
msdn.microsoft.com/library where you can read it online. For the vbscript
documentation, expand the Web Development node in the table of contents
(toc). Then the Scripting node, then the Documentation node, then Windows
Script Technology node, and lastly the VBScript node, where you will see
both a User's Guide and the Reference.
Additionally, you can download the Scripting documentation from :
[url]http://tinyurl.com/7rk6[/url]
HTH,
Bob Barrows
Astra wrote:--> Hi Aaron
>
> Where is this VB script documentation?
>
> I use wordpad/notepad and IIS/PWS to create ASP pages and I've not
> been able to source this kind of documentation in a readable format
> anyway.
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Laphan Guest



Reply With Quote

