Date field manipulation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GeoDude

    #1

    Date field manipulation

    I have a "date" field in my table in the Month/Day/Year format. I
    would like to change all the "Day" values to 1. There are about 2500
    records to change.
    Is there a query to change all the "Day" values to 1 in the date
    field.

    Thanks,

    Ivan

  • fredg

    #2
    Re: Date field manipulation

    On Thu, 12 Aug 2004 13:05:23 -0700, GeoDude wrote:
    [color=blue]
    > I have a "date" field in my table in the Month/Day/Year format. I
    > would like to change all the "Day" values to 1. There are about 2500
    > records to change.
    > Is there a query to change all the "Day" values to 1 in the date
    > field.
    >
    > Thanks,
    >
    > Ivan[/color]
    The format of the date doesn't matter.
    Do you mean you wish to permanently change all dates, such as
    9/14/2003 and 12/24/2002 to 9/1/2003 and 12/1/2002, etc.?

    Run an update query.
    Update YourTable Set YourTable.DateF ield =
    DateSerial(Year ([DateField]),Month([DateField]),1);

    --
    Fred
    Please only reply to this newsgroup.
    I do not reply to personal email.

    Comment

    • HJ

      #3
      Re: Date field manipulation

      Create an update query, use the DateSerial and Format commands (see Access
      Help): DateSerial(Form at(YourDate,"yy yy"), Format(YourDate ,"mm"),1).

      HJ

      "GeoDude" <iaburto@hotmai l.com> wrote in message
      news:hajnh09hie 72l4sfbbtsukanq hfs9olemv@4ax.c om...[color=blue]
      > I have a "date" field in my table in the Month/Day/Year format. I
      > would like to change all the "Day" values to 1. There are about 2500
      > records to change.
      > Is there a query to change all the "Day" values to 1 in the date
      > field.
      >
      > Thanks,
      >
      > Ivan
      >[/color]


      Comment

      Working...