|
-
Feb 2nd, 2011, 09:44 AM
#1
Thread Starter
New Member
TrueIncorrect syntax near '-'.
<%
set conn = CreateObject("ADODB.Connection")
conn.open strConnection
sql = sql="Select t.hotels_id,t.roomtype_id, t.startdate, t.enddate, t.capacity, count(t.room_no) as total_room from h_room t where t.hotels_id=" &request("id")&" and t.capacity="&request("capacity")&"and (('" & request("startdate") & "' Between t.startdate And t.enddate)) and (('" & DateAdd("d",-1,request("closingdate")) & "' Between t.startdate And t.enddate)) and not exists (SELECT DISTINCT b.room_id FROM h_bookinfo a,h_room_booked b WHERE a.bookinfo_id=(b.bookinfo_id) and hotels_id="&request("id")&" and b.room_id=t.room_id and ((manual_booking='"&true&"' or status='"&true&"') or (manual_booking='"&true&"' and status='"&true&"')) and (('" & request("startdate") & "' Between checkin_date And checkout_date Or checkin_date between '" & request("startdate") & "' and '" & DateAdd("d",-1,request("closingdate")) & "') Or ('" & DateAdd("d",-1,request("closingdate")) & "' Between checkin_date And checkout_date Or checkout_date between '" & request("startdate") & "' and '" &DateAdd("d",-1,request("closingdate")) & "') ))group by t.hotels_id,t.roomtype_id,t.capacity,t.startdate,t.enddate"
on error resume next
conn.execute(sql)
if err.number <> 0 then
response.write(sql)
if conn.errors.count > 0 then
for each e in conn.errors
response.write e.description & "<br>"
next
end if
response.end
end if
-
Feb 2nd, 2011, 11:48 AM
#2
Re: TrueIncorrect syntax near '-'.
<?asp
If you.HaveErrors Then
threadpost = New Message
threadpost.coherently = True
threadpost.askquestion = True
threadpost.Description = "Clear message"
threadpost.Post(ToVBForums)
End If
If threadpost.style = clear Then
threadpost.WillGetAnswers = True
You.Rejoice()
Else
threadpost.WillGetAnswers = False
threadpost.Replies = New threapost(style.NonSensical, "Remove Eels from Hovercraft")
End if
-tg
Last edited by techgnome; Feb 2nd, 2011 at 11:52 AM.
-
Feb 2nd, 2011, 09:17 PM
#3
Re: TrueIncorrect syntax near '-'.
 Originally Posted by techgnome
... threadpost.Replies = New threapost(style.NonSensical, "Remove Eels from Hovercraft")-tg
Cute 
The OP may not get it, but if he looks in your signature links, maybe he will
-
Feb 3rd, 2011, 12:22 AM
#4
Re: TrueIncorrect syntax near '-'.
What's the value stored in the variable sql? If you could post that, the error would be more obvious to spot.
<Sigh> and please remember we are geeks/nerds who can't read English. We are better at reading code.
.
Last edited by honeybee; Feb 3rd, 2011 at 12:23 AM.
Reason: tg, you missed the closing tag!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|