i have one employee tabel with 4 coloums
emp name emp id employee salary tax
john 001 30k
smith 112 15k
joe 113 45k
i have to fill tax coloum =25% when salary >=30k otherwise just --
can any one tell me the query ?
sivak
-7
Junior Poster
Recommended Answers
Jump to PostDo you mean that your data actually contains the charcter 'K' in the salary value ?
(that would be ugly)
Assuming that it is true:UPDATE dbo.Employee SET TAX = ( 1.25 * Convert(int,substring(Salary,1,len(Salary)-1) ) WHERE Salary > '30K'
**free handed, so perform some tests on a …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.