Update a date value to 1st of month

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi

I have an update query that places a load of snapshots
into a table storing month data for trend analysis. I
hvae to do this every month.
Ideally, Id like to just have 'Jan 04, Feb o4' but the
Data data type cannot accept that and needs a full date.
I need it as a date data type so its puts the trend data
in chronological order.

Problem. The snapshot will add the current date (now() )
which is ok. Is there away of updating that so the date
given is the 1st day of that month eg

4/4/04 becomes 1/4/04
20/4/04 becomes 1/4/04 etc

TIA
Tim
 
Try the following equation as the Update To value.

DateSerial(Year(Date()), Month(Date()), 1)

This will return a value of the first day of the month for the current month
and year.
 
Nice one Wayne, thanks


-----Original Message-----
Try the following equation as the Update To value.

DateSerial(Year(Date()), Month(Date()), 1)

This will return a value of the first day of the month for the current month
and year.

--
Wayne Morgan
Microsoft Access MVP





.
 
Back
Top