dbTalk Databases Forums  

How to copy the date from a date field...then...

comp.database.ms-access comp.database.ms-access


Discuss How to copy the date from a date field...then... in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Woo
 
Posts: n/a

Default How to copy the date from a date field...then... - 05-09-2006 , 02:21 AM






I'd like to copy the date from a date field on my form, strip out the
date formatting and plant the result in another field on the form. So,
the original date field would look like this:

05/08/06

and the result would look like this:

050806

in a field I'll call: DigitalDate. I've actually gotten it to work by
setting the DigitalDate format to: mmddyy, but I believe the computer
still recognizes the "date aspects" and I get a type mismatch when I
attempt my next step - concatenating DigitalDate with a field
called:LastName. Eventually my mishmash will look like this:

SMITH050806

I am attempting to have access automatically generate an ID using my
client's last name and the date they signed-on with me. Yes, it
violates good database convention, but I have my squalid little
reasons for avoiding AutoNumber. I read a blurb on Microsoft that said
dates are stored in Access as a serial number (which to my untrained
eyes looks nothing like the date you enter). Could this make what I
seek too complex?

Thanks in advance!

Reply With Quote
  #2  
Old   
Mike Easter
 
Posts: n/a

Default Re: How to copy the date from a date field...then... - 05-09-2006 , 09:31 PM






The Woo <***.www.co.> wrote in news:muf062p2l7vhkebqdojef63uits0t9rhs8@
4ax.com:

Quote:
I'd like to copy the date from a date field on my form, strip out the
date formatting and plant the result in another field on the form. So,
the original date field would look like this:

05/08/06

and the result would look like this:

050806

in a field I'll call: DigitalDate. I've actually gotten it to work by
setting the DigitalDate format to: mmddyy, but I believe the computer
still recognizes the "date aspects" and I get a type mismatch when I
attempt my next step - concatenating DigitalDate with a field
called:LastName. Eventually my mishmash will look like this:

SMITH050806
I actually just did something like this in order to create a directory
for backing up files. Using the Format function should work, despite how
Access stores the date. I don't think you need two steps. Here's what
the update value would look like given your example:

mishmash = [LastName] & Format([DigitalDate],"mmyydd")


Reply With Quote
  #3  
Old   
The Woo
 
Posts: n/a

Default Re: How to copy the date from a date field...then... - 05-11-2006 , 12:40 PM



On Tue, 09 May 2006 21:31:46 -0500, Mike Easter <username (AT) domain (DOT) com>
wrote:

Quote:
I actually just did something like this in order to create a directory
for backing up files. Using the Format function should work, despite how
Access stores the date. I don't think you need two steps. Here's what
the update value would look like given your example:

mishmash = [LastName] & Format([DigitalDate],"mmyydd")
A simple and elegant solution which worked right out of the box! I
thank you!


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.