I just decided to leave Mssql and start using Mysql. I am having some problems with my queries; is there anyone here who has a knowledge of query syntax in Mysql?
Is it possible to use IIF function in SQL query?like that for example:
objCommand.CommandText = "Select WCUST, IIF(Sum(WQTY2002) Is Not Null, ((Sum(WQTY2003)-Sum(WQTY2002)) * 100/Sum(WQTY2002)),Null) AS ChangeUnits, IFF(Sum(WAMT2002) Is Not Null, ((Sum(WAMT2003)-Sum(WAMT2002)) * 100/Sum(WAMT2002)), Null) from tabTest group by WCUST;"
I'm having a problem With Query5, inserting the 'HF' variable into the DB, PF and HF both print out correct values when asked to do so. I think its a problem with my SQL query syntax but i'm at a loss as to what could be wrong.
The Error the Browser sends is - "Expected end of statement" Code:
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.
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 trying to modify and update a column in the access dB by using a form on the first page, and then the update sql statement on the second page.
For some reason the error its throwing at me is this
Microsoft JET Database Engine error '80040e14' Syntax error in UPDATE statement. /willdata/password.asp, line 34
When I use the same update statement directly into the access dB it works, if I even hard code in values in the ASP page I still get an error - I now cannot see for looking: Code:
What is this all about? Generally I run against SQL Server but now I have to use access. The query I want to run is a simple double join
SELECT tblArtists.*,tblGenres.name AS genreName,tblPages.pageId FROM (tblArtists INNER JOIN tblGenres ON tblArtists.genreId = tblGenres.genreId) LEFT JOIN tblPages ON tblArtists.artistId = tblPages.artistId ORDER BY surName ASC, firstName ASC
Now If I run this question in access against the database it accurateley returns two posts. BUT When I paste the same query into an asp document and runs it with a fileDSN against the same database it returns nothing!? Is this some kind of joke from Microsoft?
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().
I'm trying to run an access query with one parameter that is a string. I can call a query that has no parameters. I can also call a query that has one parameter that is an integer. But the one that has a string parameter isn't working.
I've tried using a command object and it did the same thing. Is there any other way I can get my query to return the records. Running it in access works.
I have a Acces query which creates a table using manipulated data from another table. I want my asp page to run this query after doing an update to the database.
I've got a query that works fine when used in mySQL but completely fails when I try to apply it to MS Access, weird thing is that it is just a copy of a stored procedure that works fine in the same copy (with the Request.QueryString replaced by a fixed value) ! Any explaination would be great, ID is a number BTW :
SELECT page_title,ID,page_content FROM content WHERE ID='" & Request.QueryString("ID") & "' '
Had a look at aspfaq.com but couldn't find anything that applys.
Is it possible to write an SQL statement that reads from an Access Query instead of an Access Table. If so is the syntax the same as for reading a Table.
I have a field called store, I have more than 1 row with the same store name in the store field.
I need to coolect all the stores from the store field, remove any duplicates, like I might have buy.com twice and only need it to show once in the drop down. And sort ascending (by store name).
Summary. Database is called: tracker The table (and the only table) is called merchants I only want to pull data from the field store, remove duplicate store names, sort ascending.
I can figure out how to plug the required htm around the asp code, to auto populate the drop down.
I am trying to query an Access database using the like operation; however, when I test the query in the browser all records from the database are displayed. Here is my code:
I'm attempting to limit a query which is being ordered by a date field to 10 records. The date field contains duplicate values, which are sorted from most recent, back. However their suggestion of sorting by a secondary field is not providing acceptable results (it returns all the rows in the database). Does anyone have any suggestions of another way around this?
What is the best way to create new queries and/or modify existing tables within an online access database. At the moment, I am periodically downloading the db and making alterations. But, I have heard others on the list say they use a query analayzer built on a <form> where they execute SQL statements. Is this the correct way to go?