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-07 : 11:22:09
|
| Hello friends,This is Access query:select Int(nz(emp_hours),0)FROM empIn SQL:CREATE VIEW emp_vw ASselect Int(nz(emp_hours),0)FROM empIt doesn't recognize INT function, do you know how to convert the INT function in access to SQL function?Thanks.Jenny.The stupid question is the question you don't ask.www.single123.com |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2004-10-07 : 11:30:12
|
| CREATE VIEW emp_vw ASSELECT CONVERT(INT, emp_hours)FROM empMark |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-10-07 : 11:39:34
|
| jenny -- remember that handy Access/SQL conversion I gave you? That should tell you how to translate the NZ() from Access into SQL.otherwise, Mark has it right -- use CONVERT (or CAST) in T-SQL. Do you have books on-line or a good beginning T-SQL book?- Jeff |
 |
|
|
jennypretty
Yak Posting Veteran
96 Posts |
Posted - 2004-10-07 : 11:57:33
|
| That does the INT job, but not NZ function.Smith, I got the ISNULL to replace for nz in access.I got one sql book, but one book never has enough information.My question is, how do I create a sql view based on this access query?select Int(nz(emp_hours),0)FROM empThanks.Jen.The stupid question is the question you don't ask.www.single123.com |
 |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2004-10-07 : 12:06:53
|
| Sorry Jenny, missed that NZ(). I'm not very familiar with Access functions having not touched it for several years!You can approximate this in SQL with:SELECT CONVERT(INT, ISNULL(emp_hours, 0))FROM empMark |
 |
|
|
jennypretty
Yak Posting Veteran
96 Posts |
Posted - 2004-10-13 : 11:50:59
|
| David, it worked successfully. Thanks so much.Jenny.The stupid question is the question you don't ask.www.single123.com |
 |
|
|
|
|
|
|
|