Forums

This topic is locked

How can I stop duplicate records in DWMX?

Posted 12 Feb 2003 01:04:19
1
has voted
12 Feb 2003 01:04:19 Paul C posted:
Hi,

Here's my problem:

I have an ASP/Access DB site in development for a client who runs a ski shop. The database he uses requires duplicate products that only differ in size and/or colour. I need a way of only displaying the one record, as opposed to half a dozen identical products when returning a recordset.

This in turn will jump to a description (master/detail page) of the product.

I've looked into the DISTINCT SQL function, but this won't work for my needs.

Can this be achieved, and if so, how?

Regards

Psmeg

: : : WZ2K : : : Digital Illusions Explained

Replies

Replied 12 Feb 2003 10:13:58
12 Feb 2003 10:13:58 Iain Stewart replied:
Hi,

Have you tried using

SELECT DISTINCT Product
from .....
if your selecting distinct from many fields you will get many paroducts if the product-code are unique.
then on the detail page filter your db by product from a url varible ?

I know you have tried distinct, but just want to see how you are using it

could you post your sql statement ?

Iain

head hurts, 'mental note to self, stop banging head !'
Replied 12 Feb 2003 22:59:46
12 Feb 2003 22:59:46 Rafi Mellado replied:
I always use GROUP BY
instead of DISTINCT

"If it weren't for the last minute, nothing would get done."
Replied 13 Feb 2003 22:30:12
13 Feb 2003 22:30:12 Paul C replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> could you post your sql statement ?<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

<pre id=code><font face=courier size=2 id=code>
SELECT MODEL, id, SUPPLIER, PROD_TYPE, BRANDS, CATEGORY, COLOUR, SIZE, GENDER, PRICE
FROM GENPRODUCTS
WHERE PROD_TYPE = 'MMColParam'
ORDER BY MODEL ASC
</font id=code></pre id=code>

Thats the SQL WITHOUT the distinct command... I need to make the MODEL field distinct as there are several entries that only differ in the SIZE field.

Regards

Psmeg

: : : WZ2K : : : Digital Illusions Explained
Replied 14 Feb 2003 12:21:41
14 Feb 2003 12:21:41 Iain Stewart replied:
Ok,

I think what you want is data shapping.
When you filter the recordest you want only one product say

Jacket1
Jacket2
Jacket3

not

Jacket1 size 3
Jacket1 size 4
Jacket1 size 5
Jacket2 size 4
Jacket2 size 6
Jacket3 size 7
if so look at data shapping, you need to make some changes to the repeat region code, its fairly easy to do

look at

www.macromedia.com/support/ultradev/ts/documents/line_break_reports.htm

hope this helps

Iain

head hurts, 'mental note to self, stop banging head !'
Replied 14 Feb 2003 13:22:36
14 Feb 2003 13:22:36 Paul C replied:
Cheers iaintkd,

I'll take a nose at it and see how it goes. But, on first look it may be more than I need. I only really want to show the actual item (not repeated) and the size, etc. is not needed. I just need to make the model a link to the detail page that can specify colour/size info.

Thanks for taking the time to help.

Regards

Psmeg

: : : WZ2K : : : Digital Illusions Explained
Replied 14 Feb 2003 14:40:02
14 Feb 2003 14:40:02 Iain Stewart replied:
Hi there no bother,

try something like

SELECT MODEL, id, SUPPLIER, PROD_TYPE, BRANDS, CATEGORY, COLOUR, SIZE, GENDER, PRICE
FROM GENPRODUCTS
WHERE PROD_TYPE = 'MMColParam'
Group By MODEL,PROD_TYPE
ORDER BY MODEL ASC

off the top of my head might work.
The data shapping might be useful for your detail page, to show one model with all the colours and sizes available, just a thought.



Iain

head hurts, 'mental note to self, stop banging head !'

Reply to this topic