I would like to know if there is a way to add and subtract 1 second from a timestamp? The results will be used in where clause to provide the upper and lower limits for a between... something like what you see below... which of course does not work:
select table2.char_column1, table2.timestamp_column2 from table1, table2 where table1.char_column = table2.char_column and table2.timestamp_column2 between dateadd(ss,-1,table1.timestamp_column2) and dateadd(ss,1,table1.timestamp_column2)
I need to use a timestamp range as a condition in the where clause to retrieve a specific row in table2. The code above simply returns all of the rows from the second table. :(
If someone can provide me with the correct syntax and a brief explanation as to why this code above does not work, I would appreciate it.
Thank you all for your time...