Page 1 of 1
Julian date
Posted: 2021-10-17 04:07
by AEmpeno
Hello,
I have a date field and I created a Julian date field. I would like to convert the date field into Julian date field as Julian date format. Is that possible? Has anyone tried it before? Thanks!
Re: Julian date
Posted: 2021-10-17 08:19
by pbottcher
Hi,
maybe you can try to get the julian date from your date field MYDATE (example) with
TO_DAYS(MYDATE)+1721060
Re: Julian date
Posted: 2021-10-18 03:23
by AEmpeno
Thanks for your reply, pböttcher. Here is what I'm getting.
2459505 = 10/17/2021 (date)
SELECT TO_DAYS(date)+1721060
FROM `brine_lot`
WHERE `brine_lot`.`id`='%ID%'
Re: Julian date
Posted: 2021-10-18 18:27
by pbottcher
Hi,
which is correct, or what would you expect?
Re: Julian date
Posted: 2021-10-18 18:58
by AEmpeno
Yes, I'm expecting as 21290 as the answer:
10/17/2021 = 21290 (21-Year, 290-10/17)
Re: Julian date
Posted: 2021-10-21 15:06
by pbottcher
Hi,
good to know what type you are looking for.
Try
Code: Select all
SELECT (YEAR(date)-2000)*1000 + DAYOFYEAR(date)
FROM `brine_lot`
WHERE `brine_lot`.`id`='%ID%'
Re: Julian date
Posted: 2021-11-10 17:39
by AEmpeno
Thanks, pböttcher! It worked!