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 |
|
supersql
Yak Posting Veteran
99 Posts |
Posted - 2005-09-22 : 11:29:35
|
| HI, Here is my query..select *from fileh fhinner join documenth dh on fh.filehid=dh.filehid inner join documentt dt on fh.filehid=dt.filehidinner join documentv dv on fh.filehid=dv.filehidThis join has total of 40 columns from all the 4 tables. How can I use this query to select only 4 columns, 1 from each table.Do I need to assign this query to a variable and select only 4 columns from tht variable. |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2005-09-22 : 11:49:25
|
| Select fh.ColumnX, dh.ColumnY, dt.ColumnZ, dv.ColumnZZTopFROM fileheaders fh ... |
 |
|
|
supersql
Yak Posting Veteran
99 Posts |
Posted - 2005-09-22 : 14:34:14
|
| HiFor the same query when I have a where clause like"where amount='4184.0600'"I am getting the follwing error.Server: Msg 260, Level 16, State 1, Line 1Disallowed implicit conversion from data type varchar to data type money, table 'test.dbo.DocumentT', column 'Amount'. Use the CONVERT function to run this query. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2005-09-22 : 14:38:59
|
| what is your question? The error statement told you how to fix the error?Help us help YOU!Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx*need more coffee*SELECT * FROM Users WHERE CLUE > 0(0 row(s) affected) |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2005-09-22 : 15:06:19
|
| Try omitting the single quotes. It makes a VARCHAR datatype."where amount=4184.0600" |
 |
|
|
supersql
Yak Posting Veteran
99 Posts |
Posted - 2005-09-22 : 15:22:20
|
| thanks Sam, its working fine. |
 |
|
|
|
|
|