473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to solve this syntex error?

Hello, I am a beginner to SQL. I am working on a work related request and receiving the following syntex error:

Msg 156, Level 15, State 1, Line 58
Incorrect syntax near the keyword 'AS'.

I had originally wanted to change the date format to mmddyyyy. Currently it's in yyyymmdd. Can you also check if I use the convert function correctly? Thanks for the feedbacks!

[code]
CREATE TABLE #ID112
(ACCT# NUMERIC)

--="INSERT INTO #ID112 VALUES ("&A2&")"


SELECT A.ACCT#
, E.PANEL#
, E.PGMTYP
, E.DDCONT

INTO #ID112_1
FROM #ID112 A
JOIN HALS_MFC.HALS.MTGLIBPN.INSOLDPL E
ON A.ACCT# = E.ACCT#

SELECT DISTINCT
A.ACCT#
,ISNULL(B.NAME1, C.NAME1) "NAME"
,ISNULL(B.ADDRS, C.ADDRS) ADDRS
,ISNULL(B.CTYST, C.CTYST) CTYST
,ISNULL(B.ZIP, C.ZIP) ZIP
,ISNULL(B.CLSDCD, C.CLSDCD) CLSDCD
,ISNULL(B.LKOTCD, C.LKOTCD) LKOTCD
,ISNULL(B.WARNCD, C.WARNCD) WARNCD
,D.CERTF# AS Cert#
,CertDate = convert (datetime, convert(varchar, D.CERTFD)
,D.MAPDTE AS MapDate
,A.PANEL#
,D.COMMUN AS Commun#
,D.CMSTAT AS CommunSt
,D.FLZONE
,D.DDVEND AS Vendor#
,A.DDCONT AS CntrctTyp
,A.PGMTYP AS PRGM

INTO #ID112_FINAL
FROM #ID112_1 A
LEFT
JOIN dbo.CHMSTRAA B
ON A.ACCT# = B.ACCT#
LEFT
JOIN dbo.HHMSTRPL C
ON A.ACCT# = C.ACCT#
LEFT
JOIN dbo.INSOLDPL D
ON A.ACCT# = D.ACCT#
[\code]
Dec 29 '10 #1
1 1256
ck9663
2,878 Expert 2GB
I'm not sure you're allowed to use the #-sign for your alias name and your column name.

Good Luck!!!

~~ CK
Dec 29 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jet Leung | last post by:
When I debug my program and it return me an error call " have not handle ¡°System.StackOverflowException¡± appear in system.windows.forms.dll " How can I solve this problem??
1
by: Nikhil Patel | last post by:
Hi all, I have the following code in the asp.net page added at runtime using RegisterStartupScript. But I get an error in the browser(syntex error-no details). DisplayLookupValues is a function...
3
by: vssp | last post by:
Hai Friends While running my application i got this error. How to solve thsi error. Plesae send me any idea. PHP Warning: Cannot modify header information - headers already sent by (output...
9
by: fcvcnet | last post by:
Hi, I write a class class CSegment { public: CSegment(void); public: ~CSegment(void); public: CArray< CList< CPoint, CPoint& >, CList< CPoint, CPoint& >& m_curve;
2
by: katrinkerber | last post by:
Hello, I need help to solve a runtime error that keeps reocurring every time I try to convert an Excel file into an Acess File. I have looked through many forums trying to find help, but I have...
1
by: sathyan8294 | last post by:
i am using vb.net 2003.i am doing my project in vb.net windows application.the following code is for sending mail. Dim mymailmessage As New MailMessage Try Dim bSuccess As Boolean = True...
21
by: buss123 | last post by:
Hi, in our application we are using AJAX . but application is working in IE well but in FIREFOX it is is not opening .my doubt is wether FIREFOX will support AJAX or not
1
by: dolphin | last post by:
How to solve the error link2028?
7
by: akmaRudiliyn | last post by:
Hai everybody :). I have problem and need help. ERROR: ERROR Violation of PRIMARY KEY constraint 'PK_Table1_01'. Cannot insert duplicate key in object 'dbo.table1'. ERROR The statement has...
3
by: souravmoysau | last post by:
Hello I have created a mobile device application using C#.net 2.0.The project is successfully compiled and run using using the simulator. But when i deliver the cab fie to my client the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.