473,385 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Duplicate records - SQL Below

17
Everytime, I run this query I get 3 or 4 duplicate records. I can't figure out what is going on. Any help would be appreciated. Thanks

Expand|Select|Wrap|Line Numbers
  1. SELECT dbo.INVOICES.ORDER_NO AS "ORDER_NO", dbo.INVOICES.SALES_REP AS "SALES_REP", dbo.INVOICES.TERMS AS "TERMS", convert (varchar,cast (dbo.INVOICES.INV_AMOUNT as money),1) AS "INV_AMOUNT", dbo.INVOICES.STATUS AS "STATUS", dbo.TRCK_GRP.NAME AS "GROUP NAME", dbo.TRCK_CHO.RANK AS "CHOICE RANK", dbo.TRCK_CHO.NAME AS "CHOICE NAME", dbo.TRCK_CHO.IS_DEFAULT AS "IS_DEFAULT", dbo.TRCK_GRP.RANK AS "GROUP RANK", convert(varchar,dbo.TRCK_SEL.MODIFIED_DATE,101) AS "MODIFIED_DATE", dbo.TRCK_SEL.SUB_CODE AS "SUB_CODE", dbo.TRCK_SEL.SUB_TYPE AS "SUB_TYPE", dbo.INVOICES.ORDER_DATE AS "ORDER_DATE", dbo.TRCK_SEL.GROUP_CODE AS "GROUP_CODE", dbo.TRCK_CHO.CHOI_CODE AS "CHOI_CODE", dbo.CUST.NAME AS "NAME", dbo.PERSONAL.PFIRST AS "PFIRST", dbo.PERSONAL.EMAIL AS "EMAIL" FROM ((((((dbo.TRCK_GRP INNER JOIN dbo.TRCK_CHO ON dbo.TRCK_GRP.GROUP_CODE = dbo.TRCK_CHO.GROUP_CODE) INNER JOIN dbo.TRCK_SEL ON dbo.TRCK_CHO.CHOI_CODE = dbo.TRCK_SEL.CHOI_CODE)  INNER JOIN dbo.INVOICES ON dbo.TRCK_SEL.SUB_CODE = dbo.INVOICES.ORDER_NO)  INNER JOIN dbo.CUST ON dbo.INVOICES.CUST_CODE = dbo.CUST.CUST_CODE)  INNER JOIN dbo.ADDRESS ON dbo.CUST.CUST_CODE = dbo.ADDRESS.CUST_CODE)  LEFT OUTER JOIN dbo.PERSONAL ON dbo.PERSONAL.IDNO = dbo.INVOICES.SALES_REP)    WHERE  dbo.INVOICES.STATUS  =  8 AND dbo.TRCK_GRP.NAME  LIKE  'CREDIT CARD AUTHORIZATION' AND dbo.TRCK_CHO.NAME  IN  ( 'AWAITING SIGNED CC AUTHORIZATION FORM' , 'CREDIT CARD DECLINED / EXPIRED' ) AND dbo.INVOICES.TERMS  =  'CC' AND dbo.INVOICES.PAID  =  'F' AND convert(varchar,dbo.TRCK_SEL.MODIFIED_DATE,101) = '{%Current Date MM/DD/YYYY%}' ORDER BY dbo.INVOICES.ORDER_NO ASC
Dec 10 '07 #1
1 1065
debasisdas
8,127 Expert 4TB
There might be duplicat edata in the table itself.

Kindly post your table structure.
Dec 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Robert | last post by:
How can I query an existing table and update a field in each record in the table with the occurrence count of each record e.g. update field to 1 (= first record occurrence), update field to 2 for...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
4
by: afr0ninja | last post by:
Hello! I'm still rather new to using code in access. I've come across a problem that I'm having difficulty troubleshooting. Any assistance would be greatly appreciated! I've set up a form...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
2
by: nethravathy | last post by:
Hi, The following table namely elcbtripselect contains 5147 records.I want to know wether this table contains duplicate records or not. I tried with following query 1)SELECT...
1
by: VinArt | last post by:
MS Acc 2003, XP Thank you in advance for any help. I have tables called "Makeup" and "Lines". Each makeup can have multiple lines. Goal is to create a new "makeup" with identical "lines"...
1
by: billesque | last post by:
Hello! I was wondering if it's possible to take a table in Microsoft Access that contains duplicate records (though not exactly identical) and create queries for use in a form. The form, currently...
2
by: nomvula | last post by:
hi guys i need some help to duplicate records on my form datasheet: here's the example of my form results: ClientLookup DateCaptured ForecastDate Description ForecastQuantity Forecast Actual UJ...
3
by: Tempalli | last post by:
Iam using the below code to search the duplicate records in Ms Excel before uploading to Ms access. It is working fine but i want the msgbox to display that there is a duplicate record in...
1
by: xraive | last post by:
I have a problem with this. Currently I am trying Allen's code and i am not successful. Current Design Table1 (Main Form) TravelID (PK) ApprovedBY EntreredBy BudgetCode ExpenseCode
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.