asp help

mngl1500

2[H]4U
Joined
Feb 28, 2005
Messages
3,812
OK at work I use asp to generate reports that make excel files that are then used because it is simple for me to make the sql statements and test them first.

I am having problems with this


Code:
SELECT  name.id as name.comp_id, 
name.member_type as co_type, name_address.address_1, name_address.address_2, 
name_address.zip,name_address.state_province,Name1.EMAIL, name1.id, name1.member_type, name1.first_name, name1.last_name, name.company, name.city, county_to_region.region , name.county, name.us_congress , name.state_senate, name.state_house FROM name inner join relationship on name.id = relationship.id inner join county_to_region on name.county = county_to_region.county inner join name as name1 on relationship.TARGET_ID =  name1.id INNER JOIN other_info ON Name1.ID = other_info.ID  inner join name_address on name.id = name_address.id  WHERE name_address.purpose = 'primary' and name1.email <> ' ' and name.member_type in  ('hm','fm','cm') and relationship.relation_type = 'mc'  and other_info.oi_donot_email = 0 and name.id <> '12542'order by name.state_house , name.company asc

The error from sql server management studio express is:
Code:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.

So I am wondering what is wrong with the sql query. I broke the first bit off to be on its own line since that is where the problem is.
 
i could be completely wrong but can you do " AS some.thing" with a period in the alias name, or if you can perhaps you have to quote it.
 
Before I added the name.id as name.comp_id I did have the name.member_type as co_type

and ahhhh crud I think I see my problem now.......

I should have just put name.id as comp_id

Oh well now I have to wait until Monday to fix it at work.
 
Back
Top