Results 1 to 6 of 6

Thread: Julian Date

  1. #1
    Join Date
    Feb 2017
    Posts
    3

    Unanswered: Julian Date

    Hello,

    I am trying to convert a julian date to a normal date. How can I accomplish this when the julian date is in a different data type format (text or number)? I attempted to use dataSerial(Left([FieldName],4),1,Right([FieldName],3)) but I always get the date mismatch error. Please help!

    Lamont

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,482
    Provided Answers: 11
    try dateserial(Yearvalue,MonthValue,Dayvalue)
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

  3. #3
    Join Date
    Feb 2017
    Posts
    3

    Julian date

    Not sure if I'm following how I should enter that without inputting my data field. I have one field that is a Julian date and when I try to convert it doesn't allow me because its a different data type.

  4. #4
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    1,101
    Provided Answers: 17
    Assuming that your dates are being saved as numeric strings, five characters long, the following will work:
    Code:
    datNormal = DateAdd("d", Right(strJulian, 3) - 1, CDate("01/01/" & Left(strJulian, 2)))
    That takes 17061 and returns 02/03/2017.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

  5. #5
    Join Date
    Feb 2017
    Posts
    3

    Julian date

    Unfortunately it is 7 digits long.

  6. #6
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    1,101
    Provided Answers: 17
    Throw me a bone here - how about providing an example of what you have? Or look at what I've given you, and have a go at modifying it.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •