Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:21:27+00:00 2026-06-05T02:21:27+00:00

We are having issues with an online payment gateway system sometimes duplicating transaction entries

  • 0

We are having issues with an online payment gateway system sometimes duplicating transaction entries within minutes of each other.

We want to create a record of these transactions, so we can analyse and correct them.

Single table, as follows. This shows results for only one card number. We would prefer to return only transactions that occurred on the same day, and preferably within 5 seconds of each other as with the last two rows.

txn_authcode   card_number   cardtype   txn_status   txn_value   entryTimeStamp
-------------------------------------------------------------------------------
1491109220     ....0279      Visa       FAILED       20.00       2011-06-24 19:49:00
1491109219     ....0279      Visa       FAILED       20.00       2012-05-28 22:47:57
1491109218     ....0279      Visa       FAILED       20.00       2012-05-28 22:46:39
1491109217     ....0279      Visa       FAILED       20.00       2012-05-28 22:46:35

So far, I have the following, which gets duplicate records for a given card number, but I am not sure how to granularize this even further in order to get records in the same day and preferably within 5 seconds of each other.

        select * from(
            select  t1.txn_authcode,t1.txn_status,t1.txn_value,t1.entryTimeStamp
                from    transactions t1
                where 1=1
                and exists
                (select null
                 from   transactions t2
                 where  t1.card_number = t2.card_number
                 and t1.entryTimeStamp <> t2.entryTimeStamp
                 and t2.entryTimeStamp >= '2012-05-01'
                 and t2.entryTimeStamp <= '2012-06-01'
                 --*** AND DATEDIFF ( day , t1.entryTimeStamp , t2.entryTimeStamp ) < 1 
    --(datediff above doesn't work as it can return a single record for a given card, 
--but we only want records that have at least one other transaction record on the same 
--day for the same card)

                 )
                 and t1.entryTimeStamp >= '2012-05-01'
                 and t1.entryTimeStamp <= '2012-06-01'
             )x
        order by card_number,entryTimeStamp desc

Could someone give me a hand with this please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:21:29+00:00Added an answer on June 5, 2026 at 2:21 am
    ...
    AND DATEDIFF ( day , t1.entryTimeStamp , t2.entryTimeStamp ) < 1
    AND t1.txn_authcode < t2.txn_authcode
    ...
    

    Replace your commented out part of query with the above statement and you should get what you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having issues referencing $(this) from within a the nested ajax 'success' function... I know
I'm having issues in locating an answer for this, as I don't want to
I'm having some serious issues with git, and couldn't find any solutions online. I'm
I having issues with Codeigniter sessions dying on IE randomly, I search everywhere and
Still having issues with this problem. Please help if you can. So I am
Im having issues getting this to work, maybe its not even possible? I have
Im having issues vertically positioning text inside of a text input field in Firefox.
I am having issues with the data submitted to my controller action via a
I have been having issues calling a background image in my CSS file. The
I am having issues getting an embedded video file to play using MPMoviePlayerController. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.