Solved

Convert Julian date to 12 month calendar date

Posted on 2014-09-15
10
615 Views
Last Modified: 2014-09-16
I'm using Access to connect to the Pervasive database using ODBC. I have some tables that contain a Julian Calendar date which I need to convert to a regular 12 month calendar date

PERIOD_01 = 2012213 which is August the 1st 2013 and I want in date format.

I'm using this Julian calendar here for reference. http://www.fs.fed.us/fire/partners/fepp/julian-calendar.pdf
0
Comment
Question by:Gerhardpet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40323972
see the codes from this page from M$
How to Convert Julian Days to Dates
0
 
LVL 28

Expert Comment

by:Bill Bach
ID: 40323981
Use the PSQL function DateAdd() to subtract the known value (supply the value as a nagative) from the known date. This will give you the starting date for the calendar. From there, use the same function, but supply the starting date and use positive values, and it should calculate it for you. If you are not sure how to use the DateAdd function, start the Pervasive Control Center, then help/docs, then search for DateAdd.
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40324035
Here is a one-liner:

j = 2013213
datDate = DateSerial(j \ 1000, 1, j Mod 1000)

=> 2013-08-01

/gustav
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Gerhardpet
ID: 40324128
I would rather do this in Access since I'm able to do much with my queries that I can when running them in PCC

@Gustav Brock: Can you give me a bit more details? Not sure what to do with what you have posted.
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40324138
Don't know what you wish to do, but for example a Query:

Select *, DateSerial([YourDateFieldName] \ 1000, 1, [YourDateFieldName] Mod 1000) As TrueDate
From tblYourTable

/gustav
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40324241
@Gerhardpet

did you look at the codes from the link I posted?



.
0
 
LVL 1

Author Comment

by:Gerhardpet
ID: 40324450
@gustav.

That worked

How would I add + 1 now? I want the date +1 day?

@ Rey - Yes I did but I mostly rely on Access to do the queries for me so I could not make much out of the link.
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40324842
That's easy. Modify the day parameter of DateSerial:

Select *, DateSerial([YourDateFieldName] \ 1000, 1, [YourDateFieldName] Mod 1000 + 1) As TrueDate
From tblYourTable

/gustav
0
 
LVL 1

Author Closing Comment

by:Gerhardpet
ID: 40326729
@gustav

That worked great! Thanks for your help!
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40327327
You are welcome!

/gustav
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question