Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateAdd function - "Day of Year"

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
Quote from the Help for DateAdd function:


You can use the DateAdd function to add or subtract a specified time interval from a date. For example, you can use DateAdd to calculate a date 30 days from today or a time 45 minutes from now.

To add days to date, you can use Day of Year ("y"), Day ("d"), or Weekday ("w").


What is the "Day Of Year"? It seems that it works the same as "Day".

Seaport
 
seaport,
More or less, Y is the Julian day (1-355).

CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
CMP,

I am still confused. Could you give me an example when "Day of Year" gives different result from "Day"?

Seaport

 
when "Day of Year" gives different result from "Day"
It shouldn't.
 
OK, so in DateAdd function "Day of Year" (y) works the same as "Day" (d).
My guess is that, Microsoft gives two arguments here simply because using y for Day of Year and d for Day has been the way for other functions.

Seaport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top