Hi all, I have quite a conundrum, at least for me.
I need to get the difference in minutes between the current date and a timestamp. However, I have two timestamp fields. The first one could be NULL (TIMESTAMP_1). The second one is never NULL(TIMESTAMP2). What I want to do is say give me the datediff between the max of TIMESTAMP_1 or TIMESTAMP_2 and the current time.
This is what I tried to select:
datediff(mi,max(isnull(TIMESTAMP_1,TIMESTAMP_2)),g etdate())
However, it grabs TIMESTAMP_1 if it's there and if not then it grabs TIMESTAMP_2. How can I tell it to take the max of both?
This is Sybase ASE 12.5.
Thanks for any help.