How do i convert a regular date to a julian date in a query

W

Wayne Morgan

By "Julian Date" do you mean "day of year"? If so, create a calculated field
and use the Format function or DatePart function. Format will return a
String value, DatePart will return an Integer value (both will look like
numbers, but it could make a difference if you're sorting on the field).

JulianDate: Format([Date Field], "y")
or
JulianDate: DatePart("y", [Date Field])
 
M

Marshall Barton

Depends on what you mean by Julian Date.

If you mean the year and day of year, then maybe this might
be sort of like it:

Format(datefield, "yyy")
 
G

Gijs Beukenoot

You mean the Julian data as defined by Scaliger ?

Try:
Add field to your query :
Expr1: JulDate([<datefield>])

Add a function:

Public Function JulDate( ByVal vDate as Variant) as Variant

JulDate = CLng(Format(Year(vDate), "0000") + Format(DateDiff("d",
CDate("01/01/" + Format(Year(vDate), "0000")), vDate) + 1, "000"))

End Function

Although I am
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top