Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Type of an Amount Column to have 2 decimal places

Status
Not open for further replies.

pna3

Programmer
Dec 5, 2003
21
IN
hi,

the front end of my package is Visual Basic and the back end is SQL 7.0.
I have an Amount column in one of the Tables.

the requirement is: whenever a record is saved the data in the Amount column should get saved with 2 decimal places.
e.g if the user enters 100.25 in the text box, the back end should also get saved/updated as 100.25
if the user enters 100 in the text box, the back end should get saved/updated as 100.00

I tried using "Float" data type. but that gives 1 decimal place.

kindly help.

this is very urgent
 
thatnx for your quick revert. I tried your suggestion. Thru SQL Enterprise Manager, I changed the datatype of that column to Numeric and changed the Scale to 2. After doing so when i entered the value 25.25 into the database.
However the value that gets saved is 25.00

What i require is 25.25

how do i go about it?

plz help this is urgent
 
Only thing I can think of is that there is something wrong in the VB code.

Try to open the table in EM. Right click table _> open table -> return all rows and manually type in
25.25 and go to the next line. Does it change to 25.00 then? I've never seen that before, unless triggers are defined on that field
 
thanx so much for the suggestion!

i tried it and it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top