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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -