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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 adding column to table that doesn't exist

Author  Topic 

QuietRiot
Yak Posting Veteran

67 Posts

Posted - 2007-11-19 : 09:55:11
im importing a query into excel


SELECT a.AccountNumber, a.FundId, a.ProcessingDateTime, a.TransactionID, a.CustomTransactionCode, a.TradeDate, a.PricePerShare, a.GrossAmount, a.NetAmount, a.ShareAmount, a.FeeAmount , b.TotalShares
FROM FundTransactionLines a
INNER JOIN SubAccountCurrentHoldings b
ON (b.AccountNumber = a.AccountNumber and b.FundID = a.FundID)
WHERE a.PostingDate = '11/1/2007'


lets say I want to add "RecordType" a blank column with no data before AccountNumber. there is no recordtype in those tables but I use it in excel and it would make life easier if i just imported this with all the fields preassigned. How could I get recordType (a blank column) in this query?

thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-19 : 09:56:49
[code]SELECT '' as RecordType, a.AccountNumber, a.FundId, a.ProcessingDateTime, a.TransactionID, a.CustomTransactionCode, a.TradeDate, a.PricePerShare, a.GrossAmount, a.NetAmount, a.ShareAmount, a.FeeAmount , b.TotalShares
FROM FundTransactionLines a
INNER JOIN SubAccountCurrentHoldings b
ON (b.AccountNumber = a.AccountNumber and b.FundID = a.FundID)
WHERE a.PostingDate = '11/1/2007'[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2007-11-19 : 09:56:52
SELECT '' as RecordType, a.AccountNumber, a.FundId, a.ProcessingDateTime, a.TransactionID, a.CustomTransactionCode, a.TradeDate, a.PricePerShare, a.GrossAmount, a.NetAmount, a.ShareAmount, a.FeeAmount , b.TotalShares
FROM FundTransactionLines a
INNER JOIN SubAccountCurrentHoldings b
ON (b.AccountNumber = a.AccountNumber and b.FundID = a.FundID)
WHERE a.PostingDate = '11/1/2007'

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-19 : 09:57:14
3 secs


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2007-11-19 : 09:58:02
:) Quick Draw khtan

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

QuietRiot
Yak Posting Veteran

67 Posts

Posted - 2007-11-19 : 09:59:06
cool,

guess it was easy
Go to Top of Page
   

- Advertisement -