close

I have just recently converted an access database to excel and in the data is
some fields with the date/time stored as julian seconds. In access I used to
just use a macro to convert and display it on a form, but I can no longer do
that.

I just wish to convert the data to a mm/dd/yyyy format, but I am unsure how
to with excel.

This is the function.

Function JulianSecondsToDateTime(IngJulianSeconds As Long) As Date

'Julian Seconds plus 68 years to make compatible with Access
JulianSecondsToDateTime = DateAdd(quot;yyyyquot;, 68, CDate(IngJulianSeconds / 86400))

End Function

Is there a way to do so?

One way to apply the same conversion as your Access function is:

=date(year(a1/86400) 68,month(a1/86400),day(a1/86400))

Does this help?

--
Regards,
Fredquot;Keldairquot; gt; wrote in message
...
gt;I have just recently converted an access database to excel and in the data is
gt; some fields with the date/time stored as julian seconds. In access I used to
gt; just use a macro to convert and display it on a form, but I can no longer do
gt; that.
gt;
gt; I just wish to convert the data to a mm/dd/yyyy format, but I am unsure how
gt; to with excel.
gt;
gt; This is the function.
gt;
gt; Function JulianSecondsToDateTime(IngJulianSeconds As Long) As Date
gt;
gt; 'Julian Seconds plus 68 years to make compatible with Access
gt; JulianSecondsToDateTime = DateAdd(quot;yyyyquot;, 68, CDate(IngJulianSeconds / 86400))
gt;
gt; End Function
gt;
gt; Is there a way to do so?
Yes that helps, thank you much.

quot;Fred Smithquot; wrote:

gt; One way to apply the same conversion as your Access function is:
gt;
gt; =date(year(a1/86400) 68,month(a1/86400),day(a1/86400))
gt;
gt; Does this help?
gt;
gt; --
gt; Regards,
gt; Fred
gt;
gt;
gt; quot;Keldairquot; gt; wrote in message
gt; ...
gt; gt;I have just recently converted an access database to excel and in the data is
gt; gt; some fields with the date/time stored as julian seconds. In access I used to
gt; gt; just use a macro to convert and display it on a form, but I can no longer do
gt; gt; that.
gt; gt;
gt; gt; I just wish to convert the data to a mm/dd/yyyy format, but I am unsure how
gt; gt; to with excel.
gt; gt;
gt; gt; This is the function.
gt; gt;
gt; gt; Function JulianSecondsToDateTime(IngJulianSeconds As Long) As Date
gt; gt;
gt; gt; 'Julian Seconds plus 68 years to make compatible with Access
gt; gt; JulianSecondsToDateTime = DateAdd(quot;yyyyquot;, 68, CDate(IngJulianSeconds / 86400))
gt; gt;
gt; gt; End Function
gt; gt;
gt; gt; Is there a way to do so?
gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()