Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Inserting currency into a database...

When inserting a record that is formatted as currency, do you need to handle it in a similar fashion as you do a date as far as surrounding it with a special character (date would be '#" & Request.Form("Date") &"#')?

Thanks!
Avatar of sigmacon
sigmacon

Currency values usually get inserted as decimal values. Make sure that your request field only contains digits (a valid decimal number). You then don't need any special characters around it. If you do not make sure that your form field has a valid number in it and you do not use quotes, your insert may fail depending on what the user entered. With quotes around it it will still fail if the user's input cannot be parsed into a decimal. Form field validation is key before it goes into the DB.
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial