Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi guys!

Good Day...

I have a problem in my access 2003. I have a duplicate data in my table. The 2nd column needs to be zero out when it has duplicate in 1st column. Tody i have this..

XML
TicketNumber ShippingContainer  Weight
   SRN1         2-0002-01        56
   SRN2         2-0002-01        56

                         TOTAL WT:  112




But it should be like this...

XML
TicketNumber ShippingContainer  Weight
   SRN1         2-0002-01        56
   SRN2         2-0002-01             

                         TOTAL WT:  56



The ticket number is unique and the shipping_container_number is the same. I need criteria or something so the wieght will not be repeatative as you can see in the illustration above. The shipment of a container will be shipped to different places thats why it has different ticket_number but still i need them to display all like that.

Is this possible in access. please help. I really need this to work for my report. Thanks in advance... More Powe and God Bless...

:)
Posted
Updated 3-Jan-13 18:21pm
v4

1 solution

I am not sure how possible this is, in the format you're asking for. You can get totals by selecting distinct values from shipping container. It's the total weight you're worried about, so I suspect you want to just calculate it separately, doing a distinct select that does not include the ticket number. I could tell you how to write SQL to do that but I have no clue how to do it by not programming in Access.
 
Share this answer
 
v2
Comments
Ariel Riyo 3-Jan-13 22:44pm    
first of all this makes sense.. second my point here is selecting the same data but then if the data on col1 is selected then the second data dont need to display again the column two. please comment first before posting in the solution area if you cant hlp at all.
Christian Graus 3-Jan-13 22:47pm    
Here's a tip. If it doesn't make sense to me, the person you want to do your job, then it doesn't matter if it makes sense to you. Why do you want to select SRN1 twice, but with 56 not present the second time ? If you just wanted to select no duplicates, DISTINCT would do it. As it stands, it still makes no sense.
Ariel Riyo 3-Jan-13 23:11pm    
i just made it simpler. actually i have another identifier i have 2 container but different ticket id. so itll be 2 different ticket and same container because they have different shipment and so they have same weight so the col2 here is the weight i dont want to make it appear twice because i need the sum in the report. i hope you can get me.
Christian Graus 3-Jan-13 23:50pm    
No, you've still not told us enough so we can help you. We need to know the SQL you're running, the table structure, and exactly what you're looking for, and why. One possibility I can see, is a count statenemtn on col1 and a group by, so you only get one row, but a 2 if SRN1 appeared twice.
Ariel Riyo 4-Jan-13 0:11am    
maybe ill revise the question in a bit. im just dragging the items in the access so there is n paticular codes/criteria at this moment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900