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

  • Thread starter Thread starter Guest
  • Start date Start date
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])
 
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")
 
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
 
Back
Top