My Assistant
![]() ![]() |
|
|
Nov 19 2004, 02:14 PM
Post
#1
|
|
|
UtterAccess Veteran Posts: 473 From: Vancouver BC, Canada |
Hi
I was trying to set a date in a couple of different ways. All of them are defaults for a text boxes on different forms I know how to get today's date: (M/D/Y) =now() But how do I get a date when M, D or Y isn't variable. How would I get (for example:) Feb/15/current year? It's not this: = 2/15/year(now()) tried it, didn't work Likewise: how would I set it so only the Day is not variable? = Month(now())/15/Year(now)) I know I got this all wrong. Is there any way to do what I'm trying here? John |
|
|
|
Nov 19 2004, 02:24 PM
Post
#2
|
|
|
UtterAccess Veteran Posts: 377 From: Los Angeles, CA |
You were close. Try :
CDate("2/15/" & Year(Date())) |
|
|
|
Nov 19 2004, 02:27 PM
Post
#3
|
|
|
UtterAccess VIP Posts: 3,893 From: Lansing, Michigan, USA |
QUOTE How would I get (for example:) Feb/15/current year? Here's another method: DateSerial(Year(Date()), 2, 15) ----this returns February 15 of the current year. DateSerial(Year(Date()), Month(Date()), 15) --- this returns the 15th of the current month hope this helps -AJ |
|
|
|
Nov 19 2004, 02:36 PM
Post
#4
|
|
|
UtterAccess Veteran Posts: 473 From: Vancouver BC, Canada |
Excellent!
I thank you both for the help! (IMG:http://www.utteraccess.com/forum/style_emoticons/default/notworthy.gif) (IMG:http://www.utteraccess.com/forum/style_emoticons/default/thanks.gif) At the risk of going to the well once too often: I've got a bugger of a problem at: http://www.utteraccess.com/forums/showflat...;o=&fpart=1 If either of you could spare a look, I'd really appreciate it! John |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 02:15 PM |