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!

How to get current year 1

Status
Not open for further replies.

srast

MIS
Nov 11, 2002
42
US
Hello all.
I need an expression or function that returns Jan 1, of the current year. I know Year(date) returns the year, but I also neeed the Jan 1 part, becuase I need to test if the record in question occured in the current year or not. I don't want to hardcode the date, obviously.
Any ideas would be appreciated.
Thanks.
Steve
 
Zathras:
You pointed me in the right direction. However, the function you to use is DateSerial, not Date. (I got an error saying I had the incorrect number of arguments when I tried the date function).
Thanks!
Steve
 
Ok. Glad I could help (and thanks for the star). You didn't specify which Office application you are using, so I assumed Excel which doesn't have a DATESERIAL function (at least not in Excel 97).

Just out of curiosity, what are you using?
 
Zathras,

FYI. I'm also using XL 97 and it's version of VBA does include the DateSerial function.


Regards,
Mike
 
Ok. I forgot which forum I was on. I was only considering Excel workbook functions. Not VBA. [blush]

Thanks for clearing that up for me.
 
Zathras:
I am using Access 2000, and I needed that function in a query I am using.
Thanks again!
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top