Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-09-13 : 06:31:40
|
Tara writes "I am trying to run the following in Query Analyzer and receiving the error: 'Incorrect syntax near the keyword 'LEFT'.'INSERT INTO tblFinalStdLead(name1, name2, fname, lname, address1, address2, city, state, zip_ 9, phone, cisphone, casphone, hh_ key, custno, camp_code, campaign,mail_drop, call_start, call_end, offer_no, offer_na, offer_desc, bank, branch, officer, product2, prod2_desc, product3, prod3_desc, priority, sort, account_no, balance, bal_date, winocall, fednocall, monocall, flnocall, option1, option2, option3, option4, option5, option6, option7, option8, discode, mrkt_link_no, LEFT(phone,3) as PhoneAreaCode)SELECT * FROM dbo.tblStdLeadAny suggestions? Can you use the LEFT function with an INSERT INTO statement?" |
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-09-13 : 06:32:54
|
you can not use the Left in the insert statement.Chirag |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-13 : 06:56:54
|
Unfortunately, databases are not that smart currently !You will have to do that in the SELECT statement Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-13 : 10:29:53
|
You cant specify the column with LEFT as you used. You can doInsert into table(columns)Select value1,value2,...LEFT(value10,3),..MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|