Nancy,
I create the below function in my system for reference

CREATE FUNCTION [dbo].[RemedyDateTimeToHuman] (@DateToConvert as int)  
RETURNS datetime AS  
BEGIN 
return DateAdd(s, @DateToConvert, '1/1/1970') 
END

Then in my select I use 

select dbo.RemedyDateTimeToHuman(last_modified_date)
FROM HPD_Help_Desk

By doing it in a function, I don't need to remember the syntax every time :)

-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:arslist@ARSLIST.ORG] On Behalf Of Nancy Tietz
Sent: Friday, June 08, 2012 8:59 AM
To: arslist@ARSLIST.ORG
Subject: Re: question on format of Remedy dates in SQL Server

** 

Okay I finally found it...   I used DATEADD (ss, <name of Remedy date field>, 
'19700101')  in the sql.

 

SELECT last_modified_date ,dateadd(ss, last_modified_date, '19700101') FROM 
HPD_Help_Desk WHERE ....

 

How it looks:   

 

J

 

From: Nancy Tietz [mailto:nti...@umich.edu] 
Sent: Friday, June 08, 2012 10:47 AM
To: arslist@arslist.org
Subject: question on format of Remedy dates in SQL Server

 

Hi all -

 

I'm wondering how I convert my date fields so that I can understand them in sql 
server:

Example:

SELECT  last_modified_date ,

convert(varchar(40), last_modified_date, 100)

FROM HPD_Help_Desk 

WHERE Incident_Number = 'INC000000031823';

 

 

I expected the above 'Convert' to fix the Last_modified_date integer field into 
the readable format, but it didn't.

Thank you for your help!

 

I'm using ARUtilities's SQL tool to query the data.

 

Thank you!

Nancy

 

 

_attend WWRUG12 www.wwrug.com ARSlist: "Where the Answers Are"_ 

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"

Reply via email to