money data type??

Results 1 to 3 of 3

Thread: money data type??

  1. #1
    Join Date
    Dec 1969

    Default money data type??

    I use some money data types in my database,butseem to be having little problems with it, when I insert a value of lets say $20.00 into DB and latter try to retreive and using formatcurrency()to display on web page my out put is $2.00 when it should be $20.00<BR>Im guessing because in the DB the value is 20 and when retreived it does not rocognize the 0 or something like that.<BR>is there a way so that when inserting into DB values of 0 decimals that i still could display the zero decimals when retreiving them from DB.<BR><BR>thanx al

  2. #2
    Join Date
    Dec 1969

    Default RE: money data type??

    20 in should get you 20 out. Better make sure 20 is what&#039;s getting in there. Check the database directly and make sure that it&#039;s 20. I don&#039;t know why you&#039;d only get 2.

  3. #3
    Join Date
    Dec 1969

    Default VBS doesn't ''do'' money.

    Not really. Oh, it have CCUR to convert a number to the currency data type, but that data type generally does *NOT* match the money data types you use in your DB.<BR><BR>(In particular, the CCUR currency type is a long integer with *always* [unchangeable] 4 digits to the right of the decimal point *implied*.)<BR><BR>I&#039;ve always found that, with VBS, the best thing to do is convert the data from the DB to *double* (using CDBL). And if you are storing data back into the DB, using INSERT or UPDATE, be sure to include the decimal point (use FormatNumber if need be) in the SQL code.<BR><BR>I *think* if you do both of those you&#039;ll be okay.<BR><BR>

Posting Permissions

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