Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question mark in the name of the field

Status
Not open for further replies.

VladimirKim

Programmer
Jan 20, 2005
49
US
Hi,
my sql string is this:

sql=" SELECT HDetails.HotelNum, Hotels_2k.HotelName, HDetails.ArrivalDate, HDetails.Nights, Hotel_Room_2k.AllotmentKey, Res.ResID " & _
" FROM Hotel_Room_2k INNER JOIN (Hotels_2k INNER JOIN (Res INNER JOIN HDetails ON Res.ResNum = HDetails.ResNum) ON
Hotels_2k.idhotel = HDetails.HotelNum) ON Hotel_Room_2k.idRoom = HDetails.RoomID " & _
" WHERE (HDetails.ArrivalDate >= #11/25/2004# AND HDetails.ArrivalDate <= #12/23/2004# AND (Res.ResID > 1000 AND Res.ResID < 25000 AND res.""Quote?"" = NO)AND HDetails.Cancel = No AND HDetails.AboveAllotment = No AND res.Group = No AND Hotel_Room_2k.AllotmentKey = 10035); "

This string is being used in ASP page to pull the recordset from Access 97 Database.
Everthing is ok and it even works on NT 4.0 Server, but when asp page is moved to Windows 2003 server, it's giving an error. I figured the problem is in this piece:
res.""Quote?"" = NO
Without it, it runs fine.
The name of the field contains a question mark, it is:
Quote?
It will be very difficult to change the name of this field. So is there a way to workaround this problem w/out changing the name of the field?
In Access itself the field is being reffered as res.[Quote?], but apparently that does not work in ASP.
Thanks in advance,
Vladimir
 
You really have tried res.[Quote?] ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
And this ?
AND Not res.[Quote?]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes, I tried that and the browser is giving me this error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect

 
i have a feeling it is the various conditions that say

somecolumn = No

you probably don't have a column called No, right?

are you testing for a True/False boolean value, or are you expecting to find the actual string 'No'?

rudy | r937.com | Ask the Expert | Premium SQL Articles
SQL for Database-Driven Web Sites (course starts January 9 2005)
 
Field "Quote?" has a boolean data type. so i am checking for false(No) values.
Thanks
 
Have you tried my previous suggestion ?
AND Not res.[Quote?]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes, I tried both of them
res.[Quote?]? and
AND Not res.[Quote?]
The same error message.
Thanks
 
when you say that you have tried them both, you mean that you modified your SQL to this and it still doesn't work?

Code:
sql=" SELECT HDetails.HotelNum, Hotels_2k.HotelName, HDetails.ArrivalDate, HDetails.Nights,  Hotel_Room_2k.AllotmentKey, Res.ResID " & _
" FROM Hotel_Room_2k INNER JOIN (Hotels_2k INNER JOIN (Res INNER JOIN HDetails ON Res.ResNum = HDetails.ResNum) ON 
Hotels_2k.idhotel = HDetails.HotelNum) ON Hotel_Room_2k.idRoom = HDetails.RoomID " & _
" WHERE (HDetails.ArrivalDate >= #11/25/2004# AND HDetails.ArrivalDate <= #12/23/2004# AND (Res.ResID > 1000 AND Res.ResID < 25000 AND [b]NOT res.[Quote?][/b])AND HDetails.Cancel = No AND HDetails.AboveAllotment = No AND res.Group = No AND Hotel_Room_2k.AllotmentKey = 10035); "

are Cancel, AboveAllotment and Group all boolean fields too?

Leslie
 
yes, I tried exactly like that. Still doesn't work.
Yes, those are boolean fields.
Thanks for replies, I'll just change the name of the field to "Quote" as it is supposed to be in the first place.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top