LIKE Operator For IF Statements?
Basicly I pull the whole column contents and what to test to see if the username is that list. How can I do this in an if statement. I know how to do this kind of thing in SQL (LIKE operator) but I need to test agains two recordsets. Code:
View Replies
ADVERTISEMENT
I have one string (strWeekday) which contains a single day of the week like 'monday' and another string (strDeldays) which can contain one day of the week or multiple days of the week seperated by commas like 'monday, tuesday, wednesday, thursday, etc'.
I want to execute some lines if strWeekday is equal or may contain one of the days in strDeldays. I do not know what operator and what syntax to use for this.
View Replies
View Related
Does anyone know how to convert this peice of
php code to asp?
Quote:
$xxpop= $variable1|$variable2|$variable3|$variable4
I am having problems understanding the ASP equvilent of the " | " bitwise operator.
View Replies
View Related
I have 6 textboxes where if I fill them up I want the query to search if either one of them has results found. I have this but it's not working: Code:
View Replies
View Related
iam trying to insert some data into a database but i keep getting the above error msg this is the line that is causing the problems any ideas?
Code:
sql3 = "Insert INTO course_dates ([Course_Id], [Course_Heading], [Course_Title], [Week_No], Status) VALUES ("&courseid&", "&course&", "&title&", "&weekno&", "&status&")"
here is what is printed when I response.write the sql3 statement
Insert INTO course_dates ([Course_Id], [Course_Heading], [Course_Title], [Week_No], Status) VALUES (285, NEBOSH, test, Week One, TBA)
View Replies
View Related
I'm having probs with this sql, I know it's something to do with the LIKE operator. I'm tring to see if there are any instances of a single letter from one field in a comma seperated list in another field. Code:
View Replies
View Related
my SQL keeps coming back with the following error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Clients.Area_ID = 3 AND Clients.Category_ID = 7 OR WHERE Clients.Category_ID = 7 AND Clients.All_Areas = true'.
I am trying to pull out all records where area and category match, aswell as all records where category match and all_areas = true
Any suggestions as to where I am going wrong?
Code:
View Replies
View Related
i have a drop down list that populates a table based on the user input. The table than has some products, I'm trying to have the product name link to another page with full details about the product. I'm close but just need some help with the sql. The sql is:
"Select * FROM tablename WHERE ID =" & request.Form("ID")
ID is defined as autonum in the database, the error message i'm getting is:
Syntax error (missing operator) in query expression 'ID ='.
View Replies
View Related
1) I'm getting this error: Syntax error (missing operator) in query
expression on the below statement. Can I get some advice.
2) I searched ASPFAQ and came up blank. Where can find the "rules" for when
and how to use single quotes and double quotes in ASP? Code:
View Replies
View Related
I'm getting this error:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression ''I'm not really sure what all that stuff means. Do you have the divider pages with the tabs to stick in and organize things? If so i'll take 10 of those too. Thanks.''.
/employee_forms/testing/databaseclerical.asp, line 60
when running this code: .....
View Replies
View Related
I'm getting this error:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression ''I'm not really sure what all that stuff means. Do you have the divider pages with the tabs to stick in and organize things? If so i'll take 10 of those too. Thanks.''.
/employee_forms/testing/databaseclerical.asp, line 60
when running this code: ....
View Replies
View Related
Any ideas why im getting this error from these lines of code?
" WHERE [Personnel].p_id = [specialists].[p_id] " & _
" AND*[specialists].spu_id = " & Cint(Request.form("spec"))
View Replies
View Related
valuA = (request.form("toadd"))
If valuA = "" then
SQL = "UPDATE CourseReg SET attended='Active' WHERE ID
IN("&request.form("toadd")&")"
Set RS = MyConn.Execute(SQL)
End If
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
the error
syntax error (missing operator) query expression ID IN ()
View Replies
View Related
First time poster here but I've spent a while lurking and reading the great threads here
I've got a problem that I've wrapped my head around for a few days and I can't seem to figure it out.
Im using ASP with Access 2000 DB. I want to perform a simple lookup by ID (AutoNumber in Access) and it says I am missing an operator. Code:
View Replies
View Related
I am trying to insert values into a database using an sql statement that i read from a table that contains all my different sql commands. The sql statement is stored in the following way in the table: Code:
View Replies
View Related
I am recieving the Microsoft JET Database Engine (0x80040E14) Syntax error (missing operator) in query expression when updating data that contains single quote marks, for example: Code:
View Replies
View Related
I'm trying to pass a piece of data i get from a query using a different form's passed values. This is how I get the data into the new form and how I try to pass it to the next asp page query.
<td valign=TOP width="168"><form action="HouseDetail.asp" method="post" name="MLS" id="MLS"><input name="MLS" type="hidden" value='<%=oRs("ML_Number")%>'><input name="Submit2" type="submit" value="Get Details"/></form></td>
The value='<%=oRS(ML_Number")%>' generates a real value like '2403943' - and the field I'm trying to use this value in the qry is expecting a number. But even passing the number without the single ' at both ends generates the same error message. Code:
View Replies
View Related
I need some help with some if statements in an asp page I got. My sql statement is:
sql = "select * from courseDesc"
I want to logically diplay all the information on the page. So I inserted this if statement to choose the information I want to dispaly:
<% if rs("courseName") = "whatIsCist" then
response.write(rs("description"))
end if %>
Other courseName titles I need to display the information for further down the page, include: wdt, lan, wan, programming, admissionReq1,2,&3. Does anyone see where my problem is?
View Replies
View Related
I'm having problems getting some ASP code to work with a form I'm using. I'm using the script with a multiple page form and want to print a javascript onsubmit value for just one of the forms. I'm getting errors because of the multiple IF statements and I'm not sure how to do this and have the "s show up properly in the output. Can someone tell me how to do this properly?
Code:
<% If step < 5 Then Response.Write " <form action="/script.asp" method="post" name="theForm" id="theForm" & If step < 1 Then Response.Write " onsubmit=""" & "return checkForm(this);" & End If %> & ">" & End If %>
Here is how I want it to output:
<form action="/script.asp" method="post" name="theForm" id="theForm" onsubmit="return checkForm(this);">
View Replies
View Related
is there a way to use "or, and" statements in asp,
what i want to do it do 2 seperate checks on the database and if one is true or the other one is true then display some text is this possible and also the same check again on the database but the first statement and the second statement has to be true then display some text is this possible, if yes how would i do it?
View Replies
View Related
I have a field on an asp form called hotelYesNo (YesNo value-pulldown) and a field called roomMate.
I want to do an If Then statement likeso: If hotelYesNo = Yes Then roomMate is required, but if hotelYesNo = No Then roomMate is not required.
I don't know how to get this accomplished in the asp code.
I know how to do this in Microsoft Access but not on a webpage.
How would this be done?
View Replies
View Related
I want to run a query and need to use If then statements such as: If this is output, then run this query. Is there a way to do this?
View Replies
View Related
I didn't really get a direct answer in the .net forum so I guess I'll just post it here where it should be anyway. Instead of .net I'm just going to probaly stick with 3.0. I want to have several different templates for users to browse a site in.
Since I can't use include files in ASP is there a way I can ONLY load coding in an if statement as it applys to that certain user? I want to enclose multiple images and coding into one file but only load the ONE image/code that pertains to the user. Is this possible using if statements?
View Replies
View Related
i am trying to find out if three feilds in a record match, if so send it to another page. basically see code.
Quote: rs.Open "Rental", cs, adOpenDynamic
Do Until rs.EOF
If rs.Fields("MemberID").Value=person And rs.Fields("DVDID").Value=dvd And rs.Fields("Current").Value=true then
Response.redirect "copy.asp?memberid=" & person
End If
rs.MoveNext
Loop
this does not bring up a problem just does not do it any ideas on if staemenst etc in asp thingy.
View Replies
View Related
I have a (hopefully) simple question that has been giving me some problems. I'm trying to use a simple Select statement to access some data in an access database. In access, the sql statement is as follows:
SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master
However, when I try to do this on an ASP Page, it always causes an error. I'm assuming this is because of the [] around the field name 1. (I would change the field names, but I don't have control over that).
I know when trying to use a * in the statement Where field LIKE 'A*' I needed to replace the * with a %. I was wondering if something similar had to be done in this case.
I hope my description is clear enought to follow.
View Replies
View Related
We have currently launched a website in ASP and now want to add some tracking functions.
We have banner ads and emails that we are launching.I would like to create code that will allow me to change the an image and a text link based on where the user is linking in from.
I.e If they clicked on banner xy - then the index page the images would be xy and the text box in another page would be xy. if they clicked on banner zz - then the index page the images would be zz and the text box in another page would be zz.
View Replies
View Related
I have been avoiding this issue but it keeps popping up and I cannot figure out a solution. Include statements pathed two or more folders deep they break.
This works:
<!--#include file="../includes/mo_security.asp" -->
This does not work:
<!--#include file="../../includes/mo_security.asp" -->
So basically my site files are limited to one folder deep.
Ex: ROOT/parentFolder/files.htm
One I move another level down the includes do not work anymore:
Ex: ROOT/parentFolder/childFolder/files.htm
I am on a Windows IIS server. Is there any solution to this or is it just a limitation of the include statement?
View Replies
View Related
I have a project to do that requires that I use mysql as the database. I have only used MS Access. The sql will be simple searches.
Is there a drastic difference, or just different punctuation?
Can I find a copy of mysql on the web? If so, is there any advice on installing?
View Replies
View Related
Is it possible to wirte a VBScript If statment that outputs different HTML? IE: If **** = True then do this HTML else do this HTML?
How do you do something like that?
View Replies
View Related
Question 1: How can have th asp script automatically convert the date generated by the system to a format which is acceptable by Sybase SQL (yyyymmdd)
Question 2: If the user were to insert a a string containing " ' ", how can I convert it into a special character so that it won't be treated by Sybase SQL as the start/end of a variable?
View Replies
View Related
I am using the ASP include statements for some HTML code, and I have the <body></body> tags included in an outside <!--#include--> file. Is this OK? Or could it mess something up not having the <body></body> tags in the actual page HTML?
View Replies
View Related
I am getting an error on my sql update statement and I can't find where it is. I am getting the message, "syntax error in update statement". when I do a response.write on my sql statement this is what I get back
update tblUser set lastname='Ray', firstname='David', address='petal ms', email='david@ray.com', pass='dray', where username='dray'
View Replies
View Related
Is it possible to use If Then statements in an a href tag? What I am trying to do is I am using a server side include page of navigation inside of a content management system. I have limitations on what I can manipulate and change. So just using style sheets won't do me the trick. I want to have a navigation link change a different color when you are on that section. I have the menu expanding also using if then statements. When a variable is passed somewhere else on the page as true, the menu expands. I figured I could use this in the same way to make the link change colors. I want to do something like:
<A href="#" <% If Variable_name then%> id="link <% end if %>>Link Here </a>
Is that possible? I know that i can do an If then statement and have 2 different links, one with the id and one without, but I wanted to see if I could simplify it at all. I'm not the best with ASP so there might even be better ways then that...I was just using from the little that I knew.
View Replies
View Related