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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

It's all about money! 1

Status
Not open for further replies.

jon24422531

Technical User
Jan 27, 2004
295
GB
I have added another column to an existing table and defined it as MONEY. Default Value 0.00

Now when I either use QA to update the field in an existing record OR us EM and type directly into the column it stays at 0
Code:
update worklog..worklog Set EstimatedCost = '£12.00' where faultno = '303'
Select estimatedCost, * from worklog..worklog where faultno = '303'
/*This doesn't Work either */
update worklog..worklog Set EstimatedCost = £12.00 where faultno = '303'
Where am I going wrong?

Jonathan
 
jbenson001

Thanks, I have tried that and also many other combinations including 4 decimal places, the dollar sign etc, but all it does is stay at 0. Now if I do an insert with a new record it works, but I can't update.

Jonathan
 


Why are you assigning a STRING value to your MONEY column?
Code:
 Set EstimatedCost = 12.00

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Now I know that madness is all in the mind!

Taking George's advice I've abandoned Money and turned to Decimal: 5(9,4).

Now when I run
Code:
update worklog..worklog Set EstimatedCost = '12.00' where faultno = '303'
Select EstimatedCost from worklog..worklog where faultno = '303'

The result is the same! .000

Maybe I should abandon SQL and turn to drugs!

Jonathan
 
Generate the script for the table (including default and other constraints) and post it here.. we will create the table at our end and see the behaviour.

Do you have any trigger on the table?

Regards,


Regards,


"Dream not what makes your sleep a pleasure, but what makes you work
hard to achieve it and forget your sleep (untill you achieve it)." -- SJD
 
SajidAttar

Thank you for mentioning triggers, there is an Instead of Update trigger..........

I have mentioned elsewhere in Tek-Tips about my stupidity, but for those that missed it, here it is again.

Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top