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 |
|
gemispence
Yak Posting Veteran
71 Posts |
Posted - 2006-03-02 : 12:06:26
|
| I'm trying to create a DTS package that uses CDO to send users an email. I need to create a sql query that counts two columns. I also need to create aliases for these two columns and then reference this in the sendEmail function. I have something that looks like this but I'm getting a DTS error. I think that it's because I'm not using an alias to reference Valid and Invalid. Can someone tell me how to alias the subselect columns correctly?? thanks :)select advertiseremail, accountnumber from miamiherald where AdvertiserEmail is not null (select Valid = (select count (*) from miamiherald where validad = 1), Invalid = (select count (*) as Invalid from miamiherald where validad = 0)) |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-03-02 : 23:00:50
|
| There is a problem with your query..select advertiseremail, accountnumber ,Valid = (select count (*) from miamiherald where validad = 1),Invalid = (select count (*) as Invalid from miamiherald where validad = 0)from miamiherald where AdvertiserEmail is not null |
 |
|
|
|
|
|