Date Expression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have this Expression in a query which creates the following field:
ECPONumber: [ECPOAutoN] & "/04"
The 04 meant the year 2004. Now I need to have a 05 at the end of it, but if
I replace the 04 by 05, all exisiting records end up with 05 at the end which
I don't want.
I am looking for a date expression which will show the last tow digits of
the current year without altering exisiting records.
Any help appreciated.
Thanks.
 
Do you really want the current year or do you want the year in which, for
example, an action was taken, or whatever it is that you are recording? Is
there a date/time field in the record source of the query? If there is, does
an expression such as ...

[ECPOAutoN] & "/" & Right$(Year([YourDateTimeField]), 2)

.... get you what you want?

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Hi,

Thank you for your help!
I have managed and it is working wonders!
Thanks again.
Chris

Brendan Reynolds said:
Do you really want the current year or do you want the year in which, for
example, an action was taken, or whatever it is that you are recording? Is
there a date/time field in the record source of the query? If there is, does
an expression such as ...

[ECPOAutoN] & "/" & Right$(Year([YourDateTimeField]), 2)

.... get you what you want?

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


Chris said:
I have this Expression in a query which creates the following field:
ECPONumber: [ECPOAutoN] & "/04"
The 04 meant the year 2004. Now I need to have a 05 at the end of it, but
if
I replace the 04 by 05, all exisiting records end up with 05 at the end
which
I don't want.
I am looking for a date expression which will show the last tow digits of
the current year without altering exisiting records.
Any help appreciated.
Thanks.
 
Back
Top