Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Microsoft SQL Server 2012 - Returning Duplicates

$
0
0

Some background, I'm fairly new at SQL but I'm fairly decent with Queries. We need to export some data out of SQL for a vendor to work with us but for some reason it keeps returning back a lot of duplicate records. The query statement that I'm using is

SELECT
CallLogFlagData.callLogID
, UserID
, dataSourceID
, recordedByUserID
, recordingFile
, DATEPART(yyyy,startTime) AS startYear
, DATEPART(mm,startTime) AS startMonth
, DATEPART(dd,startTime) AS startDay
, stopTime
, callerID
, outboundNumber
, descr
, notes
, transferFrom
, fileHash
, isFileToBeTransferred
, custom1
, custom2
, DNIS
, callID
, recordingProfileID
, encryptionKeyID
, fromCallLogID
, toCallLogID
FROM dbo.CallLog AS CallLog
CROSS JOIN dbo.CallLogFlagData AS CallLogFlagData
WHERE DATEPART(yy,startTime)='2016'
AND DATEPART(mm,startTime)='08'
AND DATEPART(dd,startTime)='01'

We...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>