Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2013
    Posts
    5

    Question Answered: Today's day-number

    Dear brilliant friends,

    I would like to store the today's day-number in a result-field.
    For today, January 22nd, it should show 22. When it is October 9th, it should show 282.
    You can calculate it by dateCurrent() - 01/01/2015, but this is not working when I use this as formule.
    I checked the date-functions, but I did not find the solution.
    How can I make it work?

    Your suggestions are highly appreciated.

    Kind regards,

    Dirk

  2. Best Answer
    Posted by Miner22

    "Initial experiment using this:

    1 [$JulianDate] = dateDiff(dateSerial(2015,1,1),dateSerial(2015,11,2 ),|Day|) (for MPG)
    2 Show Message ([$juliandate], , Ok)

    You can substitute a field:

    1 [$JulianDate] = dateDiff(dateSerial(2015,1,1),[DateFilled],|Day|) (for MPG)
    2 Show Message ([$juliandate], , Ok)

    You can have a variable and a field:

    1 [$TestDate] = dateSerial(2014,01,01) (for MPG)
    2 [$JulianDate] = dateDiff([$testdate],[DateFilled],|Day|) (for MPG)
    3 Show Message ([$juliandate], , Ok)

    Hope this helps.

    Bill"


  3. #2
    Join Date
    Jul 2014
    Posts
    20
    Provided Answers: 1
    Initial experiment using this:

    1 [$JulianDate] = dateDiff(dateSerial(2015,1,1),dateSerial(2015,11,2 ),|Day|) (for MPG)
    2 Show Message ([$juliandate], , Ok)

    You can substitute a field:

    1 [$JulianDate] = dateDiff(dateSerial(2015,1,1),[DateFilled],|Day|) (for MPG)
    2 Show Message ([$juliandate], , Ok)

    You can have a variable and a field:

    1 [$TestDate] = dateSerial(2014,01,01) (for MPG)
    2 [$JulianDate] = dateDiff([$testdate],[DateFilled],|Day|) (for MPG)
    3 Show Message ([$juliandate], , Ok)

    Hope this helps.

    Bill

  4. #3
    Join Date
    Apr 2013
    Posts
    5

    Thank you

    Dear Bill,

    Brilliant solution. Nice to learn every day.

    I changed the formula to dateDiff( [$_date] , dateSerial(2016,1,1) , |Day| ) + 1
    and it worked!

    I only need to change the 2016 to a variable which contains the this year's year.

    But thread answered!
    Enjoy your weekend!!

    Dirk

  5. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd cheat... Can you use:
    Code:
    dateDiff([$_date], dateSerial(Year([$_date]), 1, 1) , |Day| ) + 1
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #5
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2
    ..........
    Last edited by spyroot; 01-30-16 at 20:30.

Tags for this Thread

Posting Permissions

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