** There is a SQL Server function called datdiff which lets you get the difference be two dates and return seconds. So something like:

select datediff("s",'12/31/1969 8:00:00 PM',getDate()) would get your time in seconds.


On 10/27/06, Leigh Gruber < [EMAIL PROTECTED]> wrote:
**

Hi Everyone,

 

I met a number of you at the 2005 RUG and am sorry that I didn't get to this year's gathering.  My husband and friends DID have successful English Channel relay swim over and back so I missed the event for a good reason. Hope to see you next year!

 

Now my question…. I am writing new workflow and have a direct SQL statement in an escalation which will execute occasionally.  Unfortunately I get an error due to the conversion of the $TIMESTAMP$ value into a nicely formatted date/time stamp. 

 

How can I get the current time to come out in epoch time so it will "play" nicely with the create date and the calculated offset?

 

This is the direct SQL statement.

SELECT count(*) FROM Issue
WHERE  Customer_Abbreviation = '$Customer_Abbreviation$' AND
Create_Date > ($TIMESTAMP$ - ($Threshold Days$ * 24 * 60 * 60))

And this is what I see when the SQL log is turned on for the server.
SELECT count(*) FROM Issue
WHERE  Customer_Abbreviation = 'zSENTEL' AND
Create_Date > (10/27/2006 3:33:51 PM - (28 * 24 * 60 * 60))

----------------------------------------------------^

(*** ERROR *** Line 1: Incorrect syntax near '3'. (SQL Server 170))

 

We're running SQL Server 2000 on Windows 2003 OS.

 

Many thanks,

Leigh

 

The information contained in this message may be privileged and/or confidential. If you are not the intended recipient, or responsible for delivering this message to the intended recipient, any review, forwarding, dissemination, distribution or copying of this communication or any attachment(s) is strictly prohibited. If you have received this message in error, please so notify the sender immediately, and delete it and all attachments from your computer and network.

 

__20060125_______________________This posting was submitted with HTML in it___



--
Frank Caruso
Specific Integration, Inc.
Senior Remedy Engineer
www.specificintegration.com
703-376-1249 __20060125_______________________This posting was submitted with HTML in it___

Reply via email to