is it possible to have a replace() function in an SQL query? I need to use
something like that to be able to sort my "sequential-numbers", which are
actually textfields like this:
98.1
98.10
98.2
98.3
98.4
What I want is to query these numbers, convert them by removing the dot with
the replace command and the sort the recordset on it.
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 ='.
I'm working on a page so that a user can change their password. I thought might be a simple update of a database, but everytime I do it I get the following error message. I've put x's where my ID would be showing for security purposes. Code:
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
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
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 ()
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:
I am trying to execute the following SQL Statement:
SqlApp1 = "INSERT INTO LeagueStore (Team, Played, Wins, Loses, Draws, For, Against, Points) SELECT (Team, Played, Wins, Loses, Draws, For, Against, Points) from HomeWins WHERE postponed=''"
But i am getting the following error message:
Syntax error (comma) in query expression '(Team, Played, Wins, Loses, Draws, For, Against, Points)'.
And i dont know why. All of the fields are numerical apart from TEAM is that helps.
All i want to do is Insert data from one table into another but i cant use SELECT * because one table has one extra field to the other and when i tried to amend the SQL to look like this:
SqlApp1 = "INSERT INTO LeagueStore (Team, Played, Wins, Loses, Draws, For, Against, Points) SELECT * from HomeWins WHERE postponed=''"
i get this error:
Number of query values and destination fields are not the same
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:
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:
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.
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:
I am working on a project using an access db. Here is the problem.
Error Code: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'unit=6400s' Unit is what it is suppose to be, I don't understand why I am getting this error? Here's the code for this part.
Code: sql="SELECT * FROM " & tableStr & " WHERE Model=" & unitStr
tableStr and unitStr are variables. Table and unit are passed into the page and are assigned to the two variables through a request.querystring().
My code retrieves a username and a password from a form. Then this information is compared to some usernames and passwords that are stored in a database. The important thing here is that the comparison must be case sensitive meaning that "passWord" is not the same thing as "password"
I have this code, working fine in access 2003
SQL = "SELECT * FROM users WHERE StrComp(username_column,'" & entered_username_in_form & "',0) = 0 AND StrComp(password_column,'" & entered_password_in_form & "',0) = 0"
but get the following error when I run it against my sql 2005 database.
[Microsoft][SQL Native Client][SQL Server]'StrComp' is not a recognized built-in function name.
I don't know the corresponding t-sql for the query.
Can anyone give me a regular expression for finding a URL in a string of text?
Essentially what I want to do is find URLs in a text string and embed them in {a href...} tags. However, I haven't used regular expressions all that much in ASP/VBSCRIPT.
I need to create a regular expression for a date field that works only in the following format MM/DD/YYYY with the / in the format. No other format can be inputted into the field. I need 2 numbers for MM 2 Numbers for DD and 4 numbers for YYYY. If the users enter 1 number for month, 1 for day he should get an alert.
I have this code and thought it was working but it is not.
I am trying to validate an input field that should only accept numeric values no larger than 6 digits to the left of the decimal and up to 2 digits to the right of the decimal. The values to the right of the decimal are optional though.
so the max format should be (xxxxxx.xx)
I tried this format:
"^(d{1,6}.*d{0,2})$"
but this format takes values larger than what i want.
I'm going down the road of learing the pattern matching in regular expressions, and I'm trying to convert the characters into English in my head so I can see whats happening...
For clarity with this one...
[b]([^]]+)[/b]
Ok - the first thing I did was break it up - because it looks a nightmare like that...so now I have..3 parts..
[b]
([^]]+)
[/b]
In part 1 I under stand that the is telling the expression that a special character is coming next, thus escaping the [ and ] respectively, thus , and in part 3 I understand the same and also the escaping of the /, thus - no problems so far...
In part 2 I'm assuming that the brackets are seperating a "pattern" so that I might reference it as $1 later on, I understand that the [^] are saying "not enclosed" so therefore it's going to ignore a ], the + sign however perplexes me - my VBScript book says "Matches the preceeding character one or more times" - so does that mean the ] just before it, or does it mean the character OR characters defined within the [ ] etc?
I'm trying to find a regular expression function to strip contents out of a string which lie between square brackets [].I've got one for chevrons (to remove HTML - as below), but would prefer not to have to replace the chevrons for square brackets first.Code:
function funRemoveHTML( strText ) Dim RegEx Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>" RegEx.Global = True
funRemoveHTML = RegEx.Replace(strText, "") end function how I can modify this for square brackets as opposed to chevrons?
A client wants have acess to an online databases records controlled by group strings and evaluation strings e.g., each use would have in his client record a group string like this:
[ROOT][ADMIN][ACCOUNTING][ABC PRODUCTS]
And each record in a database would have an evaluation string like this :
([ROOT] OR [ADMIN] OR [ACCOUNTING] OR [FINANCE]) AND [ABC PRODUCTS] OR [ACME]) etc.
No limit to the number of groups or the complexity of the boolean expression evaluation algorithm. I need an asp function that I will just pass the group string and the evaluation string and it will return True or False as to whether the client can view that particular record. I can't find anything in ASP on the internet though this must be a common database control method for non-browser applications? Has anyone done anything like this in ASP?
I'm making url's out of text starting with "www" etc. but I've got two problems. Firstly, if the string begins with www it doesn't get matched, and secondly, if there's a dot or a comma directly after the url, it becomes part of the url. I hope someone who is better at this than me will be able to help me out. Code:
reg.Pattern = "(s)(www)(S)(S+)" s = reg.Replace(s, "$1<a href=""http://$2$3$4"" target=""_blank"">$2$3$4</a>")
I have a SQL statement here that im trying to troubleshoot, it is coming up with 'join expression not supported'. I have tried the statement in the access database (in msaccess) and it works fine without any errors. The statement is as follows:
Code:
strSQL = "SELECT 'tbl Item.Art_No', 'tbl Item.Description', 'tbl Item.BA', 'tbl Item.Retail Sales Price Incl GST', 'tbl Item Bin SOH.Location', 'tbl Item Bin SOH.Blocked', 'tbl Item Bin SOH.Stock on Hand' FROM 'tbl Item' INNER JOIN 'tbl Item Bin SOH' ON 'tbl Item.Art_No' = 'tbl Item Bin SOH.Art_No'"