Update 2 fields in an existing table.

Update 2 fields in an existing table.

Post by c2Rlc2 » Sat, 03 Jun 2006 05:56:02


I have a table that comes in to access through an import. The import does
not contain the month or year so this will need to be added on a monthly
basis. I created in the table the 2 fields "Month" and "Year". I would like
to have the month and year inputed through a form and update all the records
in the table. I am okay with the form but I can not get a query to do what I
want. I know this is probably a simple thing but I must be missing
something. Any help would be greatly appreciated.
 
 
 

Update 2 fields in an existing table.

Post by SmVycnkgV2 » Sat, 03 Jun 2006 06:12:02

First off do NOT create two field for the Month and Year. Instead create only
one field and call it something like ImportDate. Make this field a Date/Time
datatype. In the Default Value of this new field put in the following:

=DatePart("m",Date()) & "/1/" & DatePart("yyyy",Date())

Now when you add a new record, it will put in something like 6/1/2006 which
will be the first day of the month and year.

Having the entire date in a date/time field allows you to use Access' many
powerful date manipulation functions.


--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

 
 
 

Update 2 fields in an existing table.

Post by c2Rlc2 » Sun, 04 Jun 2006 02:23:01


 
 
 

Update 2 fields in an existing table.

Post by c2Rlc2 » Wed, 14 Jun 2006 04:46:02

Thanks for your help. I have 2 questions. Where is the date pulling from or
creating from? Is it the date of the file that I am importing or the present
date. This works except I need to have it for the previous month. For
example: I will run May 31, 2006 information on June 1st or 2nd. I need the
date to be in the file May, 2006. Is this possible to do that?