ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   retrieving the day of the year (https://www.excelbanter.com/excel-programming/387196-re-retrieving-day-year.html)

DaveMZ[_2_]

retrieving the day of the year
 
that's possible, Mike, but I'm not sure. i switched the rows with the
columns, so that the day of the year would go down the page instead of
across, and i get the same error.

Thanks for all the help so far. Apologies, should have told people that i'm
not just retrieving these date records, but pasting them into a kind of
calendar where each column corresponds to a day. as it's set up, it retrieves
the task assigned date as the day of the month, but i would like to have it
retreive the day of the year instead. instead of a monthly layout, i would
like a yearly layout.


"Mike" wrote:

Dave I think for what you are doing the day of the year if possiable will not
work
because you will run out of columns and will get that error

"DaveMZ" wrote:

Hello, i'm wondering if anyone can help me on this.

instead of retrieving the day of the month from an Access tasks table:

st = DatePart("d", rs.Fields("tasks.task_ass_date"))
nxt = DatePart("d", rs.Fields("tasks.task_ass_date")) + 1
due = DatePart("d", rs.Fields("task_ddate"))

I would like to retrieve the day of the year:

st = DatePart("y", rs.Fields("tasks.task_ass_date"))
nxt = DatePart("y", rs.Fields("tasks.task_ass_date")) + 1
due = DatePart("y", rs.Fields("task_ddate"))

but it gives me a 1004 "application defined error."

Is this possible to do using DatePart?

Thanks



All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com