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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the Year End Date 1

Status
Not open for further replies.

sirace

MIS
Dec 8, 2003
34
US
Is there an automated way to have Excel find dates from a date that is specified only to the last day that year which is not specified? For instance, I bought a stock on February 1, 2002. I then bought more stock that year, and some in 2003. However, I only want to see any stock I bought between Feb 2, 2002 and Dec 31, 2002. However, the Year End date is not hard coded anywhere in my database. I would go in and manually enter the end dates, but I have 423000 rows.

Since the date is stored in date format MM/DD/YYYY, can I somehow take the last 4 digits, and have it always append 12/31/ to the beginning and call that the end date. That way the year is always correct.
 
This Access function returns the end of the year: DateSerial(Year(yourdate),12,31)

There is a similar Excel function.
 
Thanks, let me go ahead and give that one a try!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top