sql - Use DateDiff function to match two colunms -
i have following check:
'20'+convert(char,tc.transactiondatestamp,12) = pr.dateout , substring(tc.transactiontimestamp,1,2) + substring(tc.transactiontimestamp,4,2) + substring(tc.transactiontimestamp,7,2) = pr.timeout
this works, if time in tc.transactiontimestamp
different pr.timeout
5 seconds doesnt match. need put in check allow these 2 match if time diff 30 seconds.
any appreciated, thank you.
is this?
'20'+convert(char,tc.transactiondatestamp,12) = pr.dateout , substring(tc.transactiontimestamp,1,2)+substring (tc.transactiontimestamp,4,2)+substring (tc.transactiontimestamp,7,2) between pr.timeout , pr.timeout+30
Comments
Post a Comment