Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jennypretty
Yak Posting Veteran
96 Posts |
Posted - 2004-10-13 : 10:33:41
|
| Hello friends,I have this query in Access:select emp_num,total_salary,max_salary,Format(total_salary/max_salary) AS percent_sal, (line 4)Format(total_salary*.25)/max_salary AS bonus_sal (line 5)From emp;When I create this as an SQL View, I keep everything the same. it generate errors at line 4 & 5.Line4: 'Format' is not a recognized function name.Line5: 'Incorrect syntax near 'total_salary'Can you please help.Thanks.The stupid question is the question you don't ask.www.single123.com |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-10-13 : 10:38:48
|
you have your answer... Line4: 'Format' is not a recognized function name.for a percent, I don't know of a function to 'format' it,i believe for money you can do '$'+convert(varchar,convert(money,total_salary*.25),1)Corey |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-10-13 : 10:43:59
|
| Format(ting) is a presentation function....and should be in your front end....Access mixed DB + FrontEnd code/functionality in together...SQL deals best with DB only.However....have a look at the CAST and CONVERT functions. |
 |
|
|
jennypretty
Yak Posting Veteran
96 Posts |
Posted - 2004-10-13 : 11:16:11
|
| It doesn't work.Don't know why.Errors: 'Incorrect sysntax near '('The stupid question is the question you don't ask.www.single123.com |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-10-13 : 11:22:43
|
show us the whole statement.Go with the flow & have fun! Else fight the flow |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-10-13 : 22:12:51
|
| your access query lacks some parameters for format.what format do you need for line4 and line5?check convert or cast (as was advised) in BOL, this comes with your sql server. click start button>program files>microsoft sql server>books on lineit covers all basic questions that would give you a good start in learning tsql.--------------------keeping it simple... |
 |
|
|
|
|
|
|
|