remove duplicates but distinct wont work...


! im currently making a report page that shows all items bought in our site. im fetching values from 2 tables : products & orders. my query is working fine but it also shows duplicate entries.here is my sql query:

SELECT distinct orders.pid_ordered,orders.orderdate,products.prod_id,products.costused,products.cost1,products.cost2,products.cost3,products.cost4,products.price,products.timesbought,products.prodname FROM products,orders where DateValue(orders.orderdate) BETWEEN #1/2/2004# AND #1/7/2004# AND products.prod_id = CInt(orders.pid_ordered) order by products.timesbought desc

The prob lies in the "distinct", i was able to determine that the reason it wont work is that every product id in the orders database has different order dates so it was regarded as a distinct row. how can i still fetch the needed data without duplicates im not quite familiar with inner joins, is it the solution _______________CRYOcoustic_____________
Posted On: Tuesday 16th of October 2012 03:01:22 AM Total Views:  189
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




Email sent via SMTP upon clicking the "Submit" button

Hi Everybody,I would like to inquire for a sample code on how to enable my Web Application to send an email automatically to a specified recipient upon clicking the SUBMIT button or what ever action button I would place to my page
VIEWS ON THIS POST

91

Posted on:

Tuesday 16th October 2012
View Replies!

remove the page.asp after the link

I have a curiousity.\tHow can I remove the page.asp link from the address bar\tFor example I have a link called www.mysite.com/page.aspf=1, after the user clicks on the menu navigation.\tHow can I get rid of page.aspf=1 so that only www.mysite.com appears\tAnother thing, will request.querystring still work then
VIEWS ON THIS POST

201

Posted on:

Tuesday 16th October 2012
View Replies!

how to remove comma from text area

I am using a text area for multiple selection of entries through which i want database columns to be searched. but when i get a reponse on the next page, i get it with comma inserted in between multiple selected entries. how shuold i deal with it, so that it is searchable within a column of a database..
VIEWS ON THIS POST

184

Posted on:

Thursday 18th October 2012
View Replies!

Delete button to remove corresponding row in sql server 2005 in asp apge not working

hi , I would be really grateful if you could help me. actually i have got a table in asp page which each row having a delete button.when i click the button the corresponding row in the sql server mudt be deleted. pleas find some of my codes below Server.ScriptTimeout = 7200 if request.form("btnDel") = "Del" then call DelRow() end if sub Delrow() dim sql dim record sql = "DELETE FROM Q_table WHERE QCode='" &Request.Form("txtQCode") set record = Server.CreateObject("adodb.recordset") set record = con.Execute(sql) end sub sub LtQu() str = "SELECT QCode,QTitle,A.ABody,Date,ExpiryDate " & _ " FROM Q_table as QM INNER JOIN ABody as A ON A.ABodyC = QM.Abody " set record = Server.CreateObject("adodb.recordset") set record = con.Execute(str) RecCount = 1 do while not record.eof 'str = str & " & "" & "^" str = str & & "" & "^" 'str = str & "^" & "" & "^" end sub
VIEWS ON THIS POST

204

Posted on:

Wednesday 24th October 2012
View Replies!

Function to remove text between html tags

can someone help me create a function to remove text between html tags (so that all I have left is the html tag itself
VIEWS ON THIS POST

192

Posted on:

Friday 26th October 2012
View Replies!

2 dimensional array -> remove order (redim?)

hello experts, question to you.. I created a shoppingcart by using a 2 dimensional array. It al works fine, so adding items works correctly and removing items from the cart almost correctly. This is why i need your help. The first dimension of the array contains productcode, price, quantity etc... (4 elements in total) The second dimension contains the actual orders. Lets say i put 4 orders into the shoppingcart: 1 2 3 4 Example: When i remove order number 2, then the array has to be resorted. This all works fine but now i have order number 4 twice, because it wasn't actually removed. Here is the code: Code:
VIEWS ON THIS POST

142

Posted on:

Friday 26th October 2012
View Replies!

Auto-remove bounced email addresses from mailing list

I'm about to build a website which houses a mailing list. The site is hosted on a shared server - I don't have access to the server in terms of installing components or configuration or anything like that. I'm going to operate the list via asp - using a CDONTS loop or JMail to send the mail. I need to do one of two things however, to make sure the list is maintained and accurate. Either: 1. Somehow record bounced emails, so that they are flagged as 'expired' in the database, or even removed. Is this possible using ASP or any common mail component Or: 2. Periodically (e.g. every 90 days) send out an email to the entire list, asking them to confirm their registration. In this instance, how do I automate the script to run every 90 days without an administrator having to remember My hosting company offers a mailing list service, but it won't integrate into my database (which is something I really need, since the mails will be bespoke for each recipient - depending on what information they have signed up for). If anyone could shed any light on the best way to do this, and how it can be achieved, I'd be really grateful,
VIEWS ON THIS POST

347

Posted on:

Friday 26th October 2012
View Replies!

How to remove blanks from a list menu??

One of my tables is used for two purposes so there are blanks in the column I'm filtering. I tried using an IF statement but it still put the blanks in the list menu. Any idea how to remove the blank items\t My code: Code:
VIEWS ON THIS POST

216

Posted on:

Friday 26th October 2012
View Replies!

check array for duplicates

I have a array arrNames -- Is there any easy way that I can check that no duplicates exist in the array and if there are duplicates return the name that is a duplicate
VIEWS ON THIS POST

100

Posted on:

Friday 26th October 2012
View Replies!

remove multiple lines?

i'm creating an app where the user will copy/paste BIG word documents into a textbox to save into db. problem is -> some of the documents have a lot of whitespace which needs removed. anyone know of a script / method to remove multiple lines of whitespace i.e. if i come aross a large portion of whitespace (extra lines) i want to remove them and leave only one line in it's place. tia.
VIEWS ON THIS POST

183

Posted on:

Friday 26th October 2012
View Replies!

Checking for duplicates in table

I have a user input form for sceduling conference rooms. I need to make sure that anything with the same date and time are not duplicated in the DB table so as not to overlap meetings. What would be the best method of checking for duplicates in the table before or during the forms submission to the table There is a meeting date, start time and end time field in the table. i need to make sure nothing is scheduled for the same time during the same day. Any guidance appreciated!
VIEWS ON THIS POST

85

Posted on:

Friday 26th October 2012
View Replies!

how to remove the gap between 2 images

i have problem in removing the gap between two images, pls see the attached image. coz my item name is quite long, i dun wnat it display in horizontal, i want it display as vertical. so i create the images for the character and use ascii to recognized it. my code is as below: can anyone help\t
VIEWS ON THIS POST

411

Posted on:

Friday 26th October 2012
View Replies!

Remove duplicates from array

I have an array like this: Code: arrColour = split("blue,blue,green,red,purple,blue,green,yellow",",") What I need to be able to do is to remove all items of the value "blue" from the array. I can just run a dictionary function to delete all duplicate values, because some of them need to be retained. I just need to delete all of them of a particular value. Can anyone see how this can be done
VIEWS ON THIS POST

447

Posted on:

Friday 26th October 2012
View Replies!