Jump to content

UNION ALL error


MichelleB

Recommended Posts

hi i am trying to join two tables with UNION ALL but get the following error

 

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.1.62-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and performancedate>=DATE() ORDER BY venue' at line 1

/website/unionall.asp, line 11

Table1 = Date, Venue, Artist

Table2 = performancedate, venue, artist

i need a single table that lists all dates and bookings so i can merge

this is the code

<%
Set objconn = Server.CreateObject("ADODB.Connection")
objconn.ConnectionString = ""
objconn.Open
Set objRs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT Date, Venue, Artist FROM WWGigs UNION ALL SELECT performancedate, venue, artist FROM gigs WHERE DATE>=DATE() and performancedate>=DATE() ORDER BY venue"
objRS.Open strSQL, objconn
i = 0
DIM ArrAct()
Do While Not objRS.EOF
REDIM PRESERVE ArrAct(i)
ArrAct(i) = UCASE(objRS("venue"))&"|"&objRS("artist")
objRS.MoveNext
i = i + 1
Loop
objRs.Close
%>
</head>
<body>
<table>
<tr>
<td>
<%
iRow = 1
FOR x = 0 TO UBOUND(ArrAct)
ArrSplit = SPLIT(ArrAct(x), "|")
strvenue = ArrSplit(0)
strArtist = ArrSplit(1)
Response.Write "<tr><td bgcolor=""#FFCCCC""><FONT COLOR=""#000000"" face=""Calibri""><b>"&strArtist&" - "&strvenue&"</b></td></tr>"
Response.Write ""
IF iRow = 1 THEN
Response.Write ""
iRow = 0
END IF
iRow = iRow + 1
NEXT
%>
</td>
</tr>
</table>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...