Running Total In Access Query Or Asp
I want to do a running total query , here is what i want :
I want the running total like this:
I want to do a running total query , here is what i want :
I want the running total like this:
what i want to do is run a query that counts the number of records found e.g.Code:
Query = "Select * from dbo.tblTempInv where it_anal = 10 AND cost >= 50 AND MONTH(ih_invdate) = 1"
Set tempRS =MySQLConn.Execute(Query)
how do i display the result in asp? do i not use a recordset? or is there somthing im missing.
I'm trying to display records from an MS Access DB (*.mdb) in an ASP page (table).. I don't want to display all the records though, I just want to display the total of these records..i.e in my table I would like to show how many calls someone has closed this year..(number)
Joe Bloggs ---> 100 Closed
Is this possible? I was thinking that I need to write an ADO that includes COUNT but I'm not too sure how to write this.. Here's what I have so far: Code:
Ok so after ironing the bumps out of connecting to my MySQL database in ASP, I now want to run a query. So far it's working perfectly, BUT, it only returns with one result. Code:
View Replies View RelatedI want to do the following but am not able to do it.I have one query which is:
SQL2 = "SELECT * From totalcloser INNER JOIN zipcode ON totalcloser.zip = zipcode.zip order by totalcloser.zip"
I want to store result of this query in a temp table so that now i can go ahead and compare the results in the temp table with some other table.I know i can do this in Access..but i want to do this by coding (in my program itself) where the query runs and dumps the query results in temp table and then the second query runs and does comparisons and displays the result on screen.Towards the end ,we can flush the contents of the temp table.
I am getting this error when trying to run an Update query, Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Can anyone explain to me what this means and where I'm going wrong.
View Replies View RelatedMy 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 know vb quite well now, but asp have only started in the last couple of days.
I realise that it is not possible to create a report in Access through asp (nor in vb) but i know it is possible to run the report. Therefore, has anybody know how to run reports through ASP?
I have found one web site that is seems useful, but i want to compare that code to anybody elses. If you have some code that does this then please post, as i need to get a better understanding.
I have an access DB that has some queries built in to it.
Rather than putting the SQL in to my ASP Code (which I normally do) I was hoping there is some way to run the queries which already exist in the queries portion of the access DB. The queries do require me to input a variable though.
For example, there is one query called qry_FillForm which required me to pass a value called FormID (number)
If I have the value for FormID in my asp code, is there a way I can simply get this query to run? I can always create a
strSQL string and do it that way, I was just wanting to learn if it is even possible simply call the query that is alreay in the DB without having to manually put the SQL into my asp code.
I'd like to transfer al my hard coded sql queries to access stored queries and use them with parameters. Actually, I did not find any strong information how to do that. Please, provide me official information, or give me at least one example of using it(with
Select statement or other).
I am using ASP/MS ACCESS to see how I can query the same database, via 2 formfields.
{name: - search}Textfield 1: - Search by Category
AND/OR By
{name: - searchT}Textfield 2: - Location
Currently,
strSearchwords = Trim(Request.QueryString("search")); where "search" is the name of Textfield1
Which is fine, but how can I set it so that on Submit, the string from search, and searchT are somehow joined together into one string?
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'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.
Here is the code:
[VBS]set rs = conn.execute("getArtists '" & ltr & "'")[/VBS]
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.
View Replies View RelatedI'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.
View Replies View RelatedHow can you use ASP code to execute an Access query. I want to run the query to then display updated data on the webpage.
View Replies View RelatedWhere I found this?
Like this:
SELECT
SELECT TOP N
INTO
FROM
WHERE
GROUP BY
HAVING
UNION (ALL)
ORDER BY
WITH OWNERACCESS
( http://msdn.microsoft.com/library/e.../access2sql.asp )
But with explanations (usage) and samples...
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'm using odbc and Classic ASP and I want to read the sql content of a query in an access database. ANyone have any clues?
View Replies View RelatedI 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:
View Replies View RelatedI'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?
I have the following query:
Update properties set Last_Change=#8-Mar-2006# Where properties.fdref='h3c000';
which works fine when I run it on my desktop under MS Access, but when I run it as an ASP page, I get the following error message:
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
I am using the same database bot online and offline so field names etc are exactly the same.
I have an Access database that I created a query in. The query brings fields from related tables and prompts users to perform a search based on 3 criterias.
NOTE: the prompts can be bypassed by just leaving it blank and selecting OK. So in other words, the user does not need to fill in each prompt for the search to work, it just give them a more narrowed down search if they fill more in...
Now for the ASP part... I want to create an ASP page where the use selects from 3 drop downs. These drop downs are named the same as the field names in my query. How do I get this to work??
Currently, I do the following in my ASP pages when making use of an MS
Access database:
Dim adoCon, rsSet, strSQL
Set AdoCon = server.CreateObject("ADODB.Connection")
Set RsSet = Server.CreateObject("ADODB.RecordSet")
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("MyDB.mdb")
strSQL="SELECT * FROM MyTable;"
rsSet.Open strSQL, adoCon
...do some stuff...
rsSet.Close
adoCon.Close
Set rsSet=Nothing
Set adoCon=Nothing
I have a couple queries stored in the database that I use when in MS Access.
Can I call these queries instead of using a string to specify the SQL
command?
The above seems kind of verbose for making use of a database. Can it be
simplified at all?
here's what i want to do. from an asp page, perform a search on a
table in access. i have used sql code in the asp page itself, but i'd
rather execute a query in access. i have success in running any query
(basic SELECT, SELECT with conditions _other_ than LIKE, etc..) for
some reason, when i execute the query below from the asp page, i get
no results.
the search.asp page just has a text box in a form that submits the
srchBOX field to the results.asp page.
here's the asp code from the results.asp page: Code:
I am trying to search through an access database for tickets createded with in a certin date. I am using the below code.
strdate = DateAdd("d", -2, Now())
sqlstr="SELECT * FROM Incidents WHERE TicketDate BETWEEN #"& Now() &"# AND #"& strdate &"# ;"
I verify the query with response.write and get the following.
SELECT * FROM Incidents WHERE TicketDate BETWEEN #15/07/04 19:19:32# AND #13/07/04 19:19:32# ;
I know there are 100% tickets within this date. Yet my query returns nuthing. Please help i've searched this forum for other peoples code looking for examples but end up with the same result.
I have been asked to design a page where users login.
The users list is accessable from a drop down list which is taken from an SQL server table
The user, when selected then click next to login to a page where their name, associated with thier username is displayed.
Now I am a total newbie to this, can anyone guide me in the right direction?
Im trying to figure out how i can do the following:
I used a search script to select data from the database now each record has a figure such eg. £125.56 and so you can end up with rows like:
£125.56
£12.34
£.456.76
What I want to be able to do is have a select box to the right hand side where you select certain records and if possible at the bottom will have a live update showing the total of the selected items.
Does anybody know of a script?
I am trying to add the price and shipping to equal the total price and display it in a table(receipt) I am able to get the price and shipping and handling to write to the page, but not sure how to add them together to get the total price:
The below code gives me $40.00$ 3.00 I want it to show as $43.00 ($40 + $3.00)if they ordered 500 business cards or $75.00 ($72 + $3.00)if they ordered 100 business cards.
<%
quantity = Request.QueryString("quantity")
If (quantity = "500") Then
price = "$40.00"
Else
price = "$72.00"
End If
%>
<%
shipping = "$ 3.00"
total = (price + shipping)
%>
I have an asp page that gives records that shows number of days like so:
<% Days = RSItin("Depart") - RSItin("Arrive")%>
<% response.write days %> days
How do I get the total number of days - ie:
Record 1 2 days
Record 2 4 days
TOTAL 6 days
I have a list of data in a database(access). How can I get the total rows in the database?
View Replies View Related