decimal example please

Results 1 to 3 of 3

Thread: decimal example please

  1. #1
    Join Date
    Dec 1969

    Default decimal example please

    I have sql 2000, datatype decimal, posted on asp, no answer worked. <BR>I dont change the number coming from the form.<BR>What do I have to do to get decimals into my database exactly as they are collected from my form? <BR>Then numbers will be prices and duration ie. .05 - 12.45 <BR><BR>Is there any other<BR>way to get decimals in exactly the way I get them with<BR>out rounding up and removing zeros?<BR>************((CODE)))<BR>dim Param4<BR>Set Param4 = cmd.CreateParameter("Param4", adDecimal,<BR>adParamInput)<BR>Param4.Precision = 4<BR>Param4.NumericScale = 2<BR>cmd.Parameters.Append(Param4)<BR>cmd("Param4" ) = class_duration

  2. #2
    Join Date
    Dec 1969

    Default RE: decimal example please

    A simple (though not very efficient) way would be to make the datafield a text type, and if you want to use the numbers in calcultions use the CDbl() or CCur() functions.

  3. #3
    Join Date
    Dec 1969

    Default Yuck

    sorry to say, but that&#039;s not a good solution (small understatement!)<BR><BR>You have to use the COMMAND object and set the .NumericPrecision and .Scal of the PARAMETER object.

Posting Permissions

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