I’m trying to match datetimes from two different tables. Table A has a regular time (09:29:35). Table B has a rounded time (09:30).
The time from table B could match the time from table A, or it could match the minute before due to rounding.
How can I match these times? Or, how can I ‘remove’ the seconds from table A and round the minutes on that table as well?
Thanks for the help in advance!
You can remove the seconds with a cast:
This chops the date after the seconds, f.e.
2011-06-30 19:50(16 characters long.) Adding or substracting minutes can be done withdateadd.If you combine it in a join, you get something like: