A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date syntax to show current year and day



 
 
Thread Tools Display Modes
  #1  
Old January 3rd, 2005, 10:25 PM
Dave Elliott
external usenet poster
 
Posts: n/a
Default Date syntax to show current year and day

I have this code for an unbond control on my form, I need it instead to show
the current year and beginning day of year. January 1, 2005 or whatever is
current.
Me.StartDate = DateAdd("yyyy", -1, Date) + 1


  #2  
Old January 3rd, 2005, 10:40 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"Dave Elliott" wrote in message
m
I have this code for an unbond control on my form, I need it instead
to show the current year and beginning day of year. January 1, 2005
or whatever is current.
Me.StartDate = DateAdd("yyyy", -1, Date) + 1


I'm not sure if this is what you're after, but it will always give you
January 1st of the current year:

Me.StartDate = DateSerial(Year(Date), 1, 1)

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #3  
Old January 3rd, 2005, 10:43 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Mon, 03 Jan 2005 22:25:10 GMT, "Dave Elliott"
wrote:

I have this code for an unbond control on my form, I need it instead to show
the current year and beginning day of year. January 1, 2005 or whatever is
current.
Me.StartDate = DateAdd("yyyy", -1, Date) + 1


Try DateSerial(Year(Date()), 1, 1)

John W. Vinson[MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.