[Webinar] Streamline your web hosting managementRegister Today


Decimal Data Type for Command Object Paramenter

Posted on 2003-03-02
Medium Priority
Last Modified: 2012-08-14
Hello friends,

I'm using the command object to insert and update info to a SQL Server database.  I need to have a decimal on one of my parameters, and I'm encountering this problem:

"The precision is invalid."

Here's my parameter:

.Parameters.Append = .CreateParameter("@TotalHoursWorked",                    adDecimal,     adParamInput,       9,     Request.Form("txtTotalHoursWorked"))

My stored procedure declaration is:

@TotalHoursWorked                       decimal(9,2)     = NULL

I've never tried this before so I'm could really use any help you good folks can lend.

Thank you so much, friends.

Jazon Samillano
University of North Florida
Question by:piratepatrol
  • 2
  • 2

Expert Comment

ID: 8055251
if ur using asp then try converting to double i.e

.Parameters.Append = .CreateParameter "@TotalHoursWorked", adDecimal, adParamInput, 9, CDbl(Request.Form ("txtTotalHoursWorked"))))


Author Comment

ID: 8055432
Hi umeshmohite - I tried it, and I get the same problem.  Any other suggestions?  Thanks in advance.

Accepted Solution

umeshmohite earned 200 total points
ID: 8055942
try using CDec(Request.Form ("txtTotalHoursWorked"))
if it won't work then increase the size of the input parameter b'coz i thing the number i.e coimg from Request.Form ("txtTotalHoursWorked") is greater than size 9.

Author Comment

ID: 8060981
Now I get

"Variable is undefined: 'CDec'"

Request.Form ("txtTotalHoursWorked") = "11" in this form.  

Wow, this is a hassle.  Any other suggestions, my friend?

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Custom Android App Development is the need of an hour for several businesses. If you go through the right firm for Android Application Development, it can make a huge difference to the ways in which customers interact with your business.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question