[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Compare the Date and Time of the same column in the same table

Posted on 2015-01-13
4
Medium Priority
?
90 Views
Last Modified: 2015-01-27
I need to find multiple occurrences of the exact date and time in the same "create date" column in the same table. We had an issue where a return authorization record was created on the same date and at exactly the same time, it had the same address but different names and serial numbers, I am trying to determine if there are any more that may have occurred and put some preventives measures in place to catch this.     Exact Date and Time
0
Comment
Question by:skull52
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 40547036
To find the duplicates...

SELECT DateCreated, COUNT(1) AS Cnt
FROM YourTable
GROUP BY DateCreated
HAVING COUNT(1) > 1

Open in new window

0
 
LVL 5

Expert Comment

by:MohitPandit
ID: 40547054
To fetch:

SELECT
	*
FROM YourTable
WHERE DateCreated IN
(
	SELECT DateCreated
	FROM YourTable
	GROUP BY DateCreated
	HAVING COUNT(1) > 1
)
ORDER BY DateCreated

Open in new window

0
 

Author Comment

by:skull52
ID: 40547063
Thanks for the quick response Patrick, but your query is giving me results that may not be accurate, for example  2013-07-29 10:45:04.000 shows 19 occurrences for that date and time this may because I also need to match other columns, such as address state and Zip.
0
 

Author Comment

by:skull52
ID: 40547098
OK, so... the reason I got so many occurrences, which is accurate , is that  that if the customer is returning multiple items it generates a RA number for each and uses the same time stamp.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question